Menu

#2662 [4.3] NPE when loading caret infos

open
nobody
5
2009-12-29
2006-09-13
No

Hi, I opened a file and got this exception

It seems that one Selection in the Selection[] array is
null but I cannot understand how it is possible, if
anyone has an idea ...

[error] WorkThread: Exception in AWT thread:
[error] WorkThread: java.lang.NullPointerException
[error] WorkThread: at
org.gjt.sp.jedit.EditPane.loadCaretInfo(EditPane.java:367)
[error] WorkThread: at
org.gjt.sp.jedit.EditPane$2.run(EditPane.java:164)
[error] WorkThread: at
org.gjt.sp.util.WorkThreadPool.doAWTRequest(WorkThreadPool.java:392)
[error] WorkThread: at
org.gjt.sp.util.WorkThreadPool.doAWTRequests(WorkThreadPool.java:380)
[error] WorkThread: at
org.gjt.sp.util.WorkThreadPool.access$200(WorkThreadPool.java:37)
[error] WorkThread: at
org.gjt.sp.util.WorkThreadPool$RunRequestsInAWTThread.run(WorkThreadPool.java:477)
[error] WorkThread: at
java.awt.event.InvocationEvent.dispatch(Unknown Source)
[error] WorkThread: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
[error] WorkThread: at
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
[error] WorkThread: at
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
[error] WorkThread: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
[error] WorkThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] WorkThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] WorkThread: at
java.awt.EventDispatchThread.run(Unknown Source)

Discussion

  • Matthieu Casanova

    • status: open --> closed-works-for-me
     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: YES

    It never happened again

     
  • Matthieu Casanova

    Oh it happened again when I opened a file, still no hint about it, on 4.3 final

    java.lang.NullPointerException
    at org.gjt.sp.jedit.EditPane.loadCaretInfo(EditPane.java:416)
    at org.gjt.sp.jedit.EditPane$2.run(EditPane.java:216)
    at org.gjt.sp.util.WorkThreadPool.doAWTRequest(WorkThreadPool.java:398)
    at org.gjt.sp.util.WorkThreadPool.doAWTRequests(WorkThreadPool.java:383)
    at org.gjt.sp.util.WorkThreadPool.access$200(WorkThreadPool.java:37)
    at org.gjt.sp.util.WorkThreadPool$RunRequestsInAWTThread.run(WorkThreadPool.java:483)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

     
  • Matthieu Casanova

    • labels: --> editor core
    • summary: NPE when loading caret infos --> [4.3] NPE when loading caret infos
    • status: closed-works-for-me --> open
     
  • Anonymous

    Anonymous - 2009-12-29

    Do you know if the file you opened was previously opened in jEdit in the same session?

     
  • Anonymous

    Anonymous - 2009-12-30

    I have some crazy idea. The SelectionManager is not a synchronized class, and its correctness relies on the fact that all changes to it are made from the GUI thread. Can there be any background threads that were created by plugins as a response to opening the file and that may change the selection? Then, possibly between the time the local selection array is created and the time it is filled, one of the selections may become null.

     
  • Anonymous

    Anonymous - 2009-12-30

    I think that it doesn't have to be a plugin. Some background tasks initiated by the core (e.g. Search and Replace in files) can also change the selection, while in the GUI thread it might try to load the caret info for them.
    I think that making the selection manager synchronized can solve this issue. I don't know if it will visibly affect performance.

     

Log in to post a comment.