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 248137 - NullPointerException at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles
Summary: NullPointerException at org.netbeans.modules.refactoring.java.plugins.Encapsu...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
: 251366 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-23 13:44 UTC by Exceptions Reporter
Modified: 2016-07-07 07:16 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 212934


Attachments
stacktrace (1.00 KB, text/plain)
2014-10-23 13:44 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2014-10-23 13:44:17 UTC
This bug was originally marked as duplicate of bug 219404, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.11-b03, Java(TM) SE Runtime Environment, 1.8.0_11-b12
OS: Windows 8

User Comments:
javydreamercsw: Trying to refactor.

ecerichter: Encapsulating fields.
Cursor was on attribute name. I've hit "Enter".
Cursor moved to selection box for getter.
I've hit "Ctrl+Enter" in order to confirm the generation, without changing anything from defaults.

GUEST: Encapsulating Fields

GUEST: error during refactor

GUEST: I now have this error everytime I try to encapsulate fields. It started after I updated the latest patch.

ecerichter: Encapsulating field.
I've just hint "Enter" couple of times, then realized that I really need to "Ctrl+Enter" - then the exception was thrown.

ecerichter: Trying to encapsulate fields. Reproducible always, even on 201210210002.
What I've typed:

1) Shift+Ctrl+E over variable name (to open "Encapsulate Fields" dialog).
2) Hit "Enter" over the name. It doesn't confirm the window (as it did in the past)
3) Hit "Ctrl+Enter" to confirme de window.

Error is thrown.

ecerichter: 1) Put cursor over "id" attribute.
2) Call refactory -> encapsulate fields
3) Ecapsulate fields window is shown
4) Press enter (cursor move to the checkbox)
5) Press Ctrl+Enter to confirm the window

Exception happens.

salaboy: Refactoring -> encapulating fields




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles(EncapsulateFieldRefactoringPlugin.java:459)
   at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.prepareEncapsulator(EncapsulateFieldRefactoringPlugin.java:423)
   at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldsPlugin.prepare(EncapsulateFieldsPlugin.java:198)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:437)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:421)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:232)
Comment 1 Exceptions Reporter 2014-10-23 13:44:19 UTC
Created attachment 150083 [details]
stacktrace
Comment 2 Ralph Ruijs 2015-03-24 13:19:54 UTC
*** Bug 251366 has been marked as a duplicate of this bug. ***
Comment 3 Martin Balin 2016-07-07 07:16:23 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss