UnitexGramLab / gramlab-ide

Unitex/GramLab Java IDE
https://unitexgramlab.org
Other
13 stars 27 forks source link

NullPointerException : this.buffer is null on closing a concordance window #172

Open Ofghanirre opened 1 year ago

Ofghanirre commented 1 year ago

A detailed summary of the issue goes here.

What steps will reproduce the problem?

  1. On closing a concordance windows
  2. SomeTime, a java error will appear, it seems to be related to a buffer operation.

Hypothesis trigger 1 :

  1. Locate Pattern
  2. Build concordance
  3. Keep the concordance window open
  4. ReLocate a Pattern
  5. Do not build concordance
  6. Close the pending window

It did triggered once a java error

Hypothesis trigger 2 :

  1. Locate Pattern (regex)
  2. Build concordance
  3. Keep the concordance window open
  4. ReLocate a Pattern with graph
  5. Do not build concordance
  6. Close the pending concordance window

It did triggered multiple java errors, sometime with stackstrace, sometime without...

What is the expected output?

Nothing it should just delete the window

What do you see instead?

This is the most complete stackTrace seen during the execution... Some time I only get a mere java.lang.NullPointerException message

java.lang.NullPointerException: Cannot invoke "java.nio.MappedByteBuffer.get(int)" because "this.buffer" is null
at fr.umlv.unitex.concord.ConcordanceAsListModel.getElementReallyAt(Unknown Source)
at fr.umlv.unitex.concord.ConcordanceAsListModel.getElementAt(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1443)
at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1394)
at java.desktop/javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:1032)
at java.desktop/javax.swing.plaf.basic.BasicListUI$Handler.repaintCellFocus(BasicListUI.java:2999)
at java.desktop/javax.swing.plaf.basic.BasicListUI$Handler.focusLost(BasicListUI.java:3015)
at java.desktop/java.awt.Component.processFocusEvent(Component.java:6512)
at java.desktop/java.awt.Component.processEvent(Component.java:6376)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4995)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1070)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:738)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4876)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
at java.desktop/sun.awt.SunToolkit$1.run(SunToolkit.java:484)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

More info

I'm using Unitex on UGE's local session, in unitex 3.3

martinec commented 1 year ago

Thanks for your report. This is a known bug that can be quite annoying. I have marked the issue as good-first-issue, and any help would be greatly appreciated. If you or anyone else would like to contribute, please feel free to do so.