Ticket #154 (closed defect: done)

Opened 7 years ago

Last modified 7 years ago

SimMgr GUI throws index OOB exception on startup

Reported by: jdalbey Owned by: jdalbey
Priority: Low Milestone: Sep 2019 Training
Component: Simulation Manager Version:
Severity: Trivial Keywords:
Cc:

Description

After a fresh deployment to the production workstation, starting Simulation Manager got ArrayIndexOutOfBounds exception in the GUI method
javax.swing.plaf.basic.BasicTabbedPaneUI.paintTabArea
but proceeded to run without any apparent problems.

The obvious "tabbed pane" is the Event History panel.

Perhaps this is a timing problem of some sort where Swing tries to draw the panel before the model finished initializing all the incidents.

This seems to be an intermittent bug, doesn't happen every time.

Change History

comment:1 Changed 7 years ago by jdalbey

Here's the stacktrace:

Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 0
	at javax.swing.plaf.basic.BasicTabbedPaneUI.tabForCoordinate(BasicTabbedPaneUI.java:1506)
	at javax.swing.plaf.basic.BasicTabbedPaneUI.setRolloverTab(BasicTabbedPaneUI.java:575)
	at javax.swing.plaf.basic.BasicTabbedPaneUI.access$2100(BasicTabbedPaneUI.java:54)
	at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mouseEntered(BasicTabbedPaneUI.java:3629)
	at javax.swing.plaf.synth.SynthTabbedPaneUI$1.mouseEntered(SynthTabbedPaneUI.java:293)
	at java.awt.Component.processMouseEvent(Component.java:6548)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.retargetMouseEnterExit(Container.java:4686)
	at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4664)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4515)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:715)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

comment:2 Changed 7 years ago by jdalbey

This is a bit difficult to reproduce as it's caused by mouse movement. I was able to pretty consistently reproduce it in NetBeans, clicking the Run icon, then moving the mouse down just a bit so that it's located where the Incident Tabs appear when the GUI is realized, then moving the mouse left and right. Since the exception is happening on the EventDispatchThread this seems likely to be caused by some concurrency issue; perhaps Swing is trying to draw the tabs while the main thread is creating the tab model.
My fix is to put the body of addIncidentTab (SimulationManagerView) into the EDT. This seems to solve the problem. Committed in r459.

comment:3 Changed 7 years ago by jdalbey

  • Status changed from new to closed
  • Resolution set to done
Note: See TracTickets for help on using tickets.