I'm able to intermittently, but fairly reliably, produce this NullPointerException by opening a certain folder or files within the folder (for future reference, it's location is Code/misc/astgen/nodes, although I noticed this with other sets of files as well). It seems to have more to do with the number of files (usually 30+) being opened than the names or contents of those files, but as it is intermittent, it's hard to perform reliable experiments.
edu.rice.cs.util.UnexpectedException: java.lang.NullPointerException
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.makeDocument(DocumentCache.java:184)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.getDocument(DocumentCache.java:205)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getDocument(AbstractGlobalModel.java:2803)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getPackageNameFromDocument(AbstractGlobalModel.java:2908)
at edu.rice.cs.drjava.model.AbstractGlobalModel._rawOpenFile(AbstractGlobalModel.java:4036)
at edu.rice.cs.drjava.model.AbstractGlobalModel._openFiles(AbstractGlobalModel.java:1145)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFilesHelper(AbstractGlobalModel.java:1122)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFiles(AbstractGlobalModel.java:1108)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFolder(AbstractGlobalModel.java:1219)
at edu.rice.cs.drjava.ui.MainFrame._openFolder(MainFrame.java:3822)
at edu.rice.cs.drjava.ui.MainFrame.openFolder(MainFrame.java:3813)
at edu.rice.cs.drjava.ui.MainFrame._openFolder(MainFrame.java:3558)
at edu.rice.cs.drjava.ui.MainFrame.access$1700(MainFrame.java:112)
at edu.rice.cs.drjava.ui.MainFrame$17.actionPerformed(MainFrame.java:437)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
at apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:104)
at java.awt.MenuItem.processActionEvent(MenuItem.java:597)
at java.awt.MenuItem.processEvent(MenuItem.java:556)
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:298)
at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:286)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:466)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.lang.NullPointerException
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc$2.saveDocInfo(AbstractGlobalModel.java:3132)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.kickOut(DocumentCache.java:307)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.kickOut(DocumentCache.java:294)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.remove(DocumentCache.java:285)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.add(DocumentCache.java:279)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.documentReset(DocumentCache.java:256)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.documentReset(AbstractGlobalModel.java:3345)
at edu.rice.cs.drjava.model.definitions.DefinitionsDocument.resetModification(DefinitionsDocument.java:391)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc$2.make(AbstractGlobalModel.java:3057)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.makeDocument(DocumentCache.java:181)
... 29 more
Caused by:
java.lang.NullPointerException
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc$2.saveDocInfo(AbstractGlobalModel.java:3132)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.kickOut(DocumentCache.java:307)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.kickOut(DocumentCache.java:294)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.remove(DocumentCache.java:285)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.add(DocumentCache.java:279)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.documentReset(DocumentCache.java:256)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.documentReset(AbstractGlobalModel.java:3345)
at edu.rice.cs.drjava.model.definitions.DefinitionsDocument.resetModification(DefinitionsDocument.java:391)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc$2.make(AbstractGlobalModel.java:3057)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.makeDocument(DocumentCache.java:181)
at edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.getDocument(DocumentCache.java:205)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getDocument(AbstractGlobalModel.java:2803)
at edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc.getPackageNameFromDocument(AbstractGlobalModel.java:2908)
at edu.rice.cs.drjava.model.AbstractGlobalModel._rawOpenFile(AbstractGlobalModel.java:4036)
at edu.rice.cs.drjava.model.AbstractGlobalModel._openFiles(AbstractGlobalModel.java:1145)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFilesHelper(AbstractGlobalModel.java:1122)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFiles(AbstractGlobalModel.java:1108)
at edu.rice.cs.drjava.model.AbstractGlobalModel.openFolder(AbstractGlobalModel.java:1219)
at edu.rice.cs.drjava.ui.MainFrame._openFolder(MainFrame.java:3822)
at edu.rice.cs.drjava.ui.MainFrame.openFolder(MainFrame.java:3813)
at edu.rice.cs.drjava.ui.MainFrame._openFolder(MainFrame.java:3558)
at edu.rice.cs.drjava.ui.MainFrame.access$1700(MainFrame.java:112)
at edu.rice.cs.drjava.ui.MainFrame$17.actionPerformed(MainFrame.java:437)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
at apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:104)
at java.awt.MenuItem.processActionEvent(MenuItem.java:597)
at java.awt.MenuItem.processEvent(MenuItem.java:556)
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:298)
at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:286)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:466)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Logged In: YES
user_id=1075744
Originator: NO
The exception originates in edu.rice.cs.drjava.model.AbstractGlobalModel$ConcreteOpenDefDoc$2.saveDocInfo(AbstractGlobalModel.java:3132)
_loc = doc.getCurrentLocation();
I assume doc is null. doc gets passed in edu.rice.cs.drjava.model.cache.DocumentCache$DocManager.kickOut(DocumentCache.java:307)
_rec.saveDocInfo(_doc);
After that line, _doc gets closed and then set to null. Perhaps there is a concurrency problem, and _doc is already null?
I don't think I've ever seen this bug, so I can't really verify this.