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 174856 - NPE at org.netbeans.modules.editor.NbEditorDocument.createEditor
Summary: NPE at org.netbeans.modules.editor.NbEditorDocument.createEditor
Status: RESOLVED DUPLICATE of bug 138686
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-19 09:38 UTC by Jan Lahoda
Modified: 2009-10-22 23:46 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full exception. (2.85 KB, text/plain)
2009-10-19 09:38 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2009-10-19 09:38:18 UTC
[recent builds]

MarkOccurrencesTest.testType randomly fails with:
Caused by: java.lang.NullPointerException
        at org.netbeans.modules.editor.NbEditorDocument.createEditor(NbEditorDocument.java:170)
        at org.openide.text.CloneableEditor$DoInitialize.initCustomEditor(CloneableEditor.java:497)
        at org.openide.text.CloneableEditor$DoInitialize.initVisual(CloneableEditor.java:599)
        at org.openide.text.CloneableEditor.getEditorPane(CloneableEditor.java:1067)
        at org.openide.text.CloneableEditorSupport.getOpenedPanes(CloneableEditorSupport.java:1098)
        at org.netbeans.modules.java.editor.semantic.MarkOccurrencesTest$1.run(MarkOccurrencesTest.java:294)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:117)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I will attach full exception. The test is a qa-functional test in java.editor. Happened to me too when I tried to
performed the test on my computer. I have disabled all MarkOccurrencesTest's tests on the cont. builder.
Comment 1 Jan Lahoda 2009-10-19 09:38:56 UTC
Created attachment 89678 [details]
Full exception.
Comment 2 Vitezslav Stejskal 2009-10-19 10:46:45 UTC
I saw this in my fresh build. As Honza pointed out this could related to my fixes for #174408, so I'll have a look.
Comment 3 Vitezslav Stejskal 2009-10-19 10:53:23 UTC
Ah, I'm sorry for all the panic. Marek seem to be already investigating this. Thanks
Comment 4 Jaroslav Tulach 2009-10-19 14:27:14 UTC
Happened to me too:

http://deadlock.netbeans.org/hudson/job/ergonomics/605/testReport/org.netbeans.modules.ide.ergonomics.fod/OpenEditorEnablesEditMenuFactoryTest/testIfProjectFactoryInstalled/?

Caused by: java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:853)
at 
org.netbeans.modules.ide.ergonomics.fod.OpenEditorEnablesEditMenuFactoryTest.testIfProjectFactoryInstalled(OpenEditorEnablesEditMenuFactoryTest.java:118)

Caused by: java.lang.NullPointerException
at org.netbeans.modules.editor.NbEditorDocument.createEditor(NbEditorDocument.java:170)
at org.openide.text.CloneableEditor$DoInitialize.initCustomEditor(CloneableEditor.java:497)
at org.openide.text.CloneableEditor$DoInitialize.initVisual(CloneableEditor.java:599)
at org.openide.text.CloneableEditor.getEditorPane(CloneableEditor.java:1067)
at org.openide.text.CloneableEditorSupport.getOpenedPanes(CloneableEditorSupport.java:1098)
at 
org.netbeans.modules.ide.ergonomics.fod.OpenEditorEnablesEditMenuFactoryTest$2.run(OpenEditorEnablesEditMenuFactoryTest.java:122)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
Comment 5 Jaroslav Tulach 2009-10-19 14:35:10 UTC
The code in NbEditorDocument could be written slightly more defensively and just log a warning, could it not? 
Potentially any JEditorPane can be used as a parameter to the createEditor method and it would be better to return j 
instead of throwing NPE:

    public Component createEditor(JEditorPane j) {
        return Utilities.getEditorUI(j).getExtComponent();
    }
Comment 6 Jaroslav Tulach 2009-10-20 08:36:10 UTC
*** Issue 138686 has been marked as a duplicate of this issue. ***
Comment 7 Marian Mirilovic 2009-10-20 08:51:19 UTC
10 dups during 2 days ... we will evaluate if that is a stopper during the day
Comment 8 Vladimir Voskresensky 2009-10-20 08:56:35 UTC
it is a stopper, see statistics in issue #138686 as well.
Michal, I think, this is the issue related with issue #168415 (as we discussed with you in mails)

*** This issue has been marked as a duplicate of 138686 ***
Comment 9 Marian Mirilovic 2009-10-20 09:02:52 UTC
duplicate of duplicate
Comment 10 Vitezslav Stejskal 2009-10-20 10:27:30 UTC
Ok, this and #138686 refer to the same problem, albeit the original culprit in #138686 was different. Since #138686 is
still open and P1, this issue can safely be marked as a duplicate.

*** This issue has been marked as a duplicate of 138686 ***
Comment 11 Quality Engineering 2009-10-22 23:46:48 UTC
Integrated into 'main-golden', will be available in build *200910221401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ee79a32740f
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #174856 - NPE at org.netbeans.modules.editor.NbEditorDocument.createEditor() - added a check for null EditorUI which will possibly throw ISE with debug info.