Ticket #154 (closed defect: done)
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: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.

Here's the stacktrace: