GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Exception IndexOutOfBoundsException when exiting Gate #138

Closed johann-petrak closed 3 years ago

johann-petrak commented 3 years ago

Just got this when leaving GATE 9.0-SNAPSHOT build e4210b2 (by clicking the close window icon)

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:657)
    at java.util.ArrayList.get(ArrayList.java:433)
    at gate.gui.SerialControllerEditor$CorporaComboModel.getElementAt(SerialControllerEditor.java:1425)
    at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1360)
    at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1311)
    at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2623)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:405)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:415)
    at javax.swing.DefaultListSelectionModel.removeSelectionIntervalImpl(DefaultListSelectionModel.java:576)
    at javax.swing.DefaultListSelectionModel.clearSelection(DefaultListSelectionModel.java:420)
    at javax.swing.JList.clearSelection(JList.java:2049)
    at javax.swing.plaf.basic.BasicComboPopup.setListSelection(BasicComboPopup.java:1183)
    at javax.swing.plaf.basic.BasicComboPopup.access$300(BasicComboPopup.java:65)
    at javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(BasicComboPopup.java:1017)
    at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1223)
    at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1271)
    at javax.swing.JComboBox.contentsChanged(JComboBox.java:1330)
    at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:118)
    at gate.gui.SerialControllerEditor$CorporaComboModel.access$600(SerialControllerEditor.java:1397)
    at gate.gui.SerialControllerEditor$CorporaComboModel$1.run(SerialControllerEditor.java:1456)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    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.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    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)

Seems to be a random/rare occurrence?

greenwoodma commented 3 years ago

This looks like one of the UI components (specifically the drop down for picking the corpus to run a pipeline over) is trying to update using a stale list of corpora and the corpora have been unloaded as you close GATE causing an the index out of bounds exception. Probably not a show stopper but would be nice to add a guard in the right place. Will be a nightmare to reproduce to check it's fixed though.