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.

Bug 108932 - 0705: NPE at delete w src a new Web app with faces
Summary: 0705: NPE at delete w src a new Web app with faces
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 109378 (view as bug list)
Depends on: 114608
Blocks:
  Show dependency tree
 
Reported: 2007-07-05 10:59 UTC by nouar38
Modified: 2007-11-05 13:44 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE stack (702 bytes, text/plain)
2007-07-05 11:00 UTC, nouar38
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nouar38 2007-07-05 10:59:20 UTC
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 ?)
Comment 1 nouar38 2007-07-05 11:00:29 UTC
Created attachment 44732 [details]
NPE stack
Comment 2 Tomas Mysik 2007-07-11 14:45:11 UTC
I'm not sure which component is the right one...
(org.netbeans.modules.web.core.syntax.JSPKit)
Comment 3 nouar38 2007-07-13 09:25:45 UTC
found another recent issue with same stack: 109378, you can put mine as dup of it.
thanks.
nouar.
Comment 4 Pavlo Tymoshenko 2007-07-25 13:06:35 UTC
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?
Comment 5 Marek Fukala 2007-07-25 13:23:00 UTC
*** Issue 109378 has been marked as a duplicate of this issue. ***
Comment 6 Marek Fukala 2007-07-25 13:24:08 UTC
Milo, can you please look at the issue and react to Pavel's comment? Thanks.
Comment 7 Vitezslav Stejskal 2007-07-25 14:00:28 UTC
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?
Comment 8 Miloslav Metelka 2007-07-25 14:04:58 UTC
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.
Comment 9 Vitezslav Stejskal 2007-10-10 17:06:48 UTC
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.
Comment 10 nouar38 2007-10-29 09:51:54 UTC
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.