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 32544

Summary: NPE in RootFolderNode.getCustomizer while using Bean Browser
Product: platform Reporter: cnovak <cnovak>
Component: -- Other --Assignee: Jesse Glick <jglick>
Status: VERIFIED FIXED    
Severity: blocker CC: issues
Priority: P4 Keywords: SIMPLEFIX
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: ide.log file

Description cnovak 2003-04-02 02:45:22 UTC
I got a NullPointerException while browsing a local file 
system mount on my machine w/Bean Browser:

1. Right Mouse click on a mounted local file system, and 
choose Tools -> Bean Browse Node

2. Expand the properties node.

3. NullPointerException occurs:

*********** Exception occurred ************ at Tue Apr 01 
18:30:18 PST 2003
java.lang.NullPointerException
[catch] at org.netbeans.core.RootFolderNode.getCustomizer
(RootFolderNode.java:284)
	at org.openide.nodes.FilterNode.getCustomizer
(FilterNode.java:529)
	at sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at 
org.openide.nodes.PropertySupport$Reflection.getValue
(PropertySupport.java:187)
	at 
org.netbeans.modules.apisupport.beanbrowser.PropSetKids.mak
ePropertyNode(Unknown Source)
	at 
org.netbeans.modules.apisupport.beanbrowser.PropSetKids.cre
ateNodes(Unknown Source)
	at org.openide.nodes.Children$Keys$KE.nodes
(Children.java:1855)
	at org.openide.nodes.ChildrenArray.nodesFor
(ChildrenArray.java:125)
	at org.openide.nodes.Children$Info.nodes
(Children.java:951)
	at org.openide.nodes.Children.justComputeNodes
(Children.java:457)
	at org.openide.nodes.ChildrenArray.nodes
(ChildrenArray.java:69)
	at org.openide.nodes.Children.computeNodes
(Children.java:372)
	at org.openide.nodes.Children.getNodes
(Children.java:270)
	at org.openide.nodes.Children.findChild
(Children.java:216)
	at org.openide.nodes.Children.getNodes
(Children.java:316)
.
.
.
 

I attached my ide.log to this bug.
Comment 1 cnovak 2003-04-02 02:46:13 UTC
Created attachment 9640 [details]
ide.log file
Comment 2 Jesse Glick 2003-04-02 23:38:38 UTC
The problem is that the Node.getCustomizer method is being treated as
a bean method that may be freely called. In fact it may be called only
when hasCustomizer is true, which in this case it presumably was not -
but the Bean Browser does not know that. It just sees a property and
tries to display it. I suppose it could be special-cased to suppress
the property in this case, but it seems pointless.

Note that the Bean Browser does catch exceptions thrown from getters.
Here, RootFolderNode is catching its own NPE, reporting it, and
returning null.
Comment 3 Jesse Glick 2003-04-03 01:52:17 UTC
Fixed for 4.0:

committed     Up-To-Date  1.51       
core/src/org/netbeans/core/RootFolderNode.java
Comment 4 Petr Nejedly 2004-01-13 15:15:04 UTC
*** Issue 31947 has been marked as a duplicate of this issue. ***
Comment 5 Marian Mirilovic 2005-07-13 13:22:47 UTC
closed