I get an non crashing exception when using the SwingScilabWindow component on th
Reported by Clement DAVID (@davidcl)
-- Bug description --
I get an non crashing exception when using the SwingScilabWindow component on the Xcos java code.
The SwingScilabTab.repaint() method call BarUpdater.updateBars(...) which modify the components inside the SwingScilabWindow main container. As SwingScilabTab.repaint() can be called on the Component.validateTree() method, this components modification will lead to an ArrayIndexOutOfBoundsException (array modification).
I joined the backtrace of the Container.add(...) call (components modification).
-- Scilab error message --
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1
at java.awt.Container.validateTree(Container.java:1571)
at java.awt.Container.validateTree(Container.java:1575)
at java.awt.Container.validateTree(Container.java:1575)
at java.awt.Container.validateTree(Container.java:1575)
at java.awt.Container.validate(Container.java:1540)
at java.awt.Window.dispatchEventImpl(Window.java:2476)
at java.awt.Component.dispatchEvent(Component.java:4295)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
-- How to reproduce the bug --
Created an attachment (id=1473)
Container.add(...) call which modify the number of components.