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 77578 - NPE in FieldImpl.getPartTree() for comma separated field declarations such as boolean foo, bar;
Summary: NPE in FieldImpl.getPartTree() for comma separated field declarations such as...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-08 15:16 UTC by _ sandipchitale
Modified: 2007-09-26 09:14 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 _ sandipchitale 2006-06-08 15:16:56 UTC
If I have a code like this:

package foopPackage;

public class Foo {
    private boolean foo, bar;    
}

And if try to get the getElementPartPosition() I get the NPE. 

java.lang.NullPointerException
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.FieldImpl.getPartTree
(FieldImpl.java:639)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getPartStartTre
e(MetadataElement.java:1233)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.FieldImpl.getPartStartTree
(FieldImpl.java:614)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getPartPosition
(MetadataElement.java:530)
	at org.netbeans.modules.javacore.JMManager.getElementPartPosition
(JMManager.java:783)
:
:

If I change the code to:

package foopPackage;

public class Foo {
    private boolean foo;
    private boolean bar;
    
}

I do not get the NPE.

If you want to try it - this is happeing in Mark Occurrences module.
Comment 1 Pavel Flaska 2006-06-13 13:24:28 UTC
Yes, it is a neverending story with fields declared comma separated. :-(. Fixed
in trunk.
(Not sure if we want to merge it in release55.)

Checking in org/netbeans/modules/javacore/jmiimpl/javamodel/FieldImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/FieldImpl.java,v
 <--  FieldImpl.java
new revision: 1.45; previous revision: 1.44
done
Comment 2 _ sandipchitale 2006-06-13 13:43:14 UTC
Please fix it in release55.
Comment 3 Pavel Flaska 2006-06-13 15:26:24 UTC
Checking in org/netbeans/modules/javacore/jmiimpl/javamodel/FieldImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/FieldImpl.java,v
 <--  FieldImpl.java
new revision: 1.33.2.3.2.1; previous revision: 1.33.2.3
done
Comment 4 Quality Engineering 2007-09-20 09:45:21 UTC
Reorganization of java component