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 110306 - Possible NPE in Navigator
Summary: Possible NPE in Navigator
Status: VERIFIED DUPLICATE of bug 108066
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-19 15:08 UTC by Alexander Zgursky
Modified: 2007-07-19 15:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zgursky 2007-07-19 15:08:26 UTC
It's possible to get NPE when working with the Navigator window. I couldn't reproduce it more than once, but by looking
at the code I can see the possible cause of it:
...
    private Node obtainFirstCurNode () {
        Collection nodeList = curNodes.allInstances();
        return nodeList.isEmpty() ? null : (Node)nodeList.iterator().next();
    }
...
        // #67599,108066: Some updates runs delayed, so it's possible that
        // navigator was already closed, that's why the check
        if (curNodes == null) {
            inUpdate = false;
            return;
        }
...
So, it looks like it just needs a simple check in the obtainFirstCurNode method that curNodes is not null.

Here's NPE's stacktrace:
throws java.lang.NullPointerException
	at org.netbeans.modules.navigator.NavigatorController.obtainFirstCurNode(NavigatorController.java:209)
	at org.netbeans.modules.navigator.NavigatorController.updateContext(NavigatorController.java:235)
[catch] at org.netbeans.modules.navigator.NavigatorController.run(NavigatorController.java:476)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	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)
Comment 1 Alexander Zgursky 2007-07-19 15:15:36 UTC
Sorry, was using old binaries with the new sources.. It's already fixed. Closing as a duplicate of issue 108066.

*** This issue has been marked as a duplicate of 108066 ***
Comment 2 Alexander Zgursky 2007-07-19 15:16:58 UTC
The issue was filed by mistake - was using old binaries..