This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NB 6.0 200707050000 & GF v54 & jdk 1.6u1. Create a New web application with JavaServer Faces fwk, after a Delete with sources got a NullPointerException in JSPKit.createSyntaxSupport. attaching the stack. (may not project subcomponent ?)
Created attachment 44732 [details] NPE stack
I'm not sure which component is the right one... (org.netbeans.modules.web.core.syntax.JSPKit)
found another recent issue with same stack: 109378, you can put mine as dup of it. thanks. nouar.
there is another way to reproduce this bug, just simply delete the JSP file. Here is callstack: org.netbeans.modules.web.core.syntax.folding.JspFoldManager.restartTimer(JspFoldManager.java:108) org.netbeans.modules.web.core.syntax.folding.JspFoldManager.initFolds(JspFoldManager.java:103) org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:96) org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:643) org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:576) org.netbeans.modules.editor.fold.FoldHierarchyExecution$1.propertyChange(FoldHierarchyExecution.java:662) java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333) java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270) java.awt.Component.firePropertyChange(Component.java:7192) org.openide.text.QuietEditorPane.firePropertyChange(QuietEditorPane.java:149) javax.swing.text.JTextComponent.setDocument(JTextComponent.java:412) org.openide.text.QuietEditorPane.setDocument(QuietEditorPane.java:123) org.openide.text.CloneableEditor$1.run(CloneableEditor.java:266) java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) java.awt.EventQueue.dispatchEvent(EventQueue.java:461) java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) java.awt.EventDispatchThread.run(EventDispatchThread.java:110) So i have a quiestion, why FoldHierarchyExecution calls initFolds during deleting of a file, should we filter it inside JspFoldManager or it should not be called from FoldHierarchyExecution at all?
*** Issue 109378 has been marked as a duplicate of this issue. ***
Milo, can you please look at the issue and react to Pavel's comment? Thanks.
I think that it's a side effect of the way how openide/text works with documents when creating/loading and disposing editors. I am affriaid that you will have to filter it out in JspFoldManager. When en editor is closed its editor kit is asked to create a new empty document, which is then set on the editor pane to help GC the old one or whatever the reason. In the editor infrastructure it all looks like if it were working with a new empty JSP document... What exactly does the NPE mean?
That's because of org.openide.text.CloneableEditor$1.run(CloneableEditor.java:266) a code in CloneableEditor that creates and sets an empty document into the pane: if (pane != null) { Document doc = support.createStyledDocument(pane.getEditorKit()); pane.setDocument(doc); pane.setEditorKit(null); } I don't know what's the reason of having such code there. Could it be to consume smaller memory (just an empty doc instead of doc with a text) in case the pane would not being GCed?? Any other reason? Adding Petr N. to cc. Anyway it IMHO slows down the document closing and it should be removed.
The empty document is no longer set in CloneableEditor when closing the editor. Therefore this should work fine now. Please reopen if there are still problems.
NB 6.0 daily 200710231200 & GF v2 ur1 b05 & jdk 1.6u3-b05: ok verified, no more the exception at delete. marking the issue as VERIFIED.