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 218720 - NullPointerException at com.sun.tools.javac.api.JavacTrees.getElement
Summary: NullPointerException at com.sun.tools.javac.api.JavacTrees.getElement
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-20 23:11 UTC by funkyboyz
Modified: 2015-09-17 11:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 179841


Attachments
stacktrace (2.02 KB, text/plain)
2012-09-20 23:11 UTC, funkyboyz
Details
stacktrace (2.12 KB, text/plain)
2013-03-28 10:23 UTC, jrwhitley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description funkyboyz 2012-09-20 23:11:45 UTC
Build: NetBeans IDE 7.2 (Build 201207171143)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.8-b03-424, Java(TM) SE Runtime Environment, 1.6.0_33-b03-424-11M3720
OS: Mac OS X

User Comments:
GUEST: When encapsulating a field this exception occurs but previosly the ecapsulate field dialog box has not been displaying correctly on all pc's with netbeans 7.1 installed and are unable to use this feature




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.api.JavacTrees.getElement(JavacTrees.java:191)
   at org.netbeans.modules.refactoring.java.api.MemberInfo.create(MemberInfo.java:165)
   at org.netbeans.modules.refactoring.java.ui.EncapsulateFieldPanel.initialize(EncapsulateFieldPanel.java:193)
   at org.netbeans.modules.refactoring.java.ui.EncapsulateFieldPanel$1.run(EncapsulateFieldPanel.java:174)
   at org.netbeans.modules.refactoring.java.ui.EncapsulateFieldPanel$1.run(EncapsulateFieldPanel.java:169)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:488)
Comment 1 funkyboyz 2012-09-20 23:11:49 UTC
Created attachment 124669 [details]
stacktrace
Comment 2 jrwhitley 2013-03-28 10:23:57 UTC
Created attachment 133166 [details]
stacktrace

Declared two new fields and rh-clicked to refactor->Encapsulate field
Comment 3 jrwhitley 2013-03-28 10:42:59 UTC
On attempting refactor-Encapsulate fields I had this exception, twice. I then realised I had raw XML exposed in my code as an aide-memoire. Once I commented it out, the refactor was OK
Comment 4 Ralph Ruijs 2013-03-28 11:08:56 UTC
(In reply to comment #3)
> On attempting refactor-Encapsulate fields I had this exception, twice. I then
> realised I had raw XML exposed in my code as an aide-memoire. Once I commented
> it out, the refactor was OK

Thank you for the report! can you attach a small test class showing the situation with the xml-memory-aid?
Comment 5 Martin Balin 2015-09-17 11:21:37 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.