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.
Build: NetBeans IDE Dev (Build 201210020001) VM: Java HotSpot(TM) Client VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11 OS: Windows 7 User Comments: javydreamercsw: Trying to refactor. salaboy: Refactoring -> encapulating fields Stacktrace: java.lang.NullPointerException at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles(EncapsulateFieldRefactoringPlugin.java:508) at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.prepareEncapsulator(EncapsulateFieldRefactoringPlugin.java:472) 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)
Created attachment 125254 [details] stacktrace
changeset : 090ecbb0b71e author : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date : Thu Oct 04 12:59:09 CEST 2012 summary : Removed use of deprecated method SourceUtils.getFile
Integrated into 'main-golden', will be available in build *201210050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/090ecbb0b71e User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Removed use of deprecated method SourceUtils.getFile Issue #219404 - NullPointerException at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles
Still a problem in DEV 201210210002.
It only happens if I hit "Ctrl+Enter" to confirm the window. If I click in the "confirm" button, error is not thrown.
*** Bug 220689 has been marked as a duplicate of this bug. ***
Created attachment 129227 [details] stacktrace Encapsulating field. I've just hint "Enter" couple of times, then realized that I really need to "Ctrl+Enter" - then the exception was thrown.
Problem still happen in 201305282300. Please, provide a fix for 7.4!!!
(In reply to comment #8) > Problem still happen in 201305282300. > Please, provide a fix for 7.4!!! Hard to fix without a reproducible test case. I added a null check, but would really like to solve the underlying problem. Please provide steps to reproduce.
changeset : a566f3d5bdaa
Created attachment 135267 [details] Video on how to reproduce An Image worth million of words. A video should be even more. Notice that after I open the Encapsulate Fields (I've set the keyboard shortcut Shift Ctrl E for this), I've hit Enter - and then, Ctrl+Enter to confirm the fields generation (in most applications, Ctrl+Enter is the same as hit the default button for the window).
(In reply to comment #11) > Created attachment 135267 [details] > Video on how to reproduce > An Image worth million of words. A video should be even more. > Notice that after I open the Encapsulate Fields (I've set the keyboard shortcut > Shift Ctrl E for this), I've hit Enter - and then, Ctrl+Enter to confirm the > fields generation (in most applications, Ctrl+Enter is the same as hit the > default button for the window). I followed the steps you did in the video, but this works perfectly fine for me. Tried different versioning systems and also adding the keyboard shortcut, but to no avail. Can you try if the problem still occurs in a build with a566f3d5bdaa? A comment will appear when this is integrated in the daily build.
Integrated into 'main-golden', will be available in build *201306032301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a566f3d5bdaa User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #219404 - NullPointerException at org.netbeans.modules.refactoring.java.plugins.EncapsulateFieldRefactoringPlugin.getRelevantFiles
Seems that you changes are in effect. It is working fine for me since 201306032300. Thanks, Edson