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

Summary: NullPointerException at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles
Product: java Reporter: Exceptions Reporter <exceptions_reporter>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED WONTFIX    
Severity: normal CC: dengr, ecerichter, javydreamercsw, salaboy
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 212934
Attachments: stacktrace

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