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 20121121-a0d218e90fbf) VM: Java HotSpot(TM) 64-Bit Server VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07 OS: Linux User Comments: mjanicek: Trying to refactor class name in file with multiple inner subclasses Stacktrace: java.lang.NullPointerException at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.isAlreadyInResult(RenameRefactoringPlugin.java:120) at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.addModificationToResult(RenameRefactoringPlugin.java:101) at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.collectModifications(RenameRefactoringPlugin.java:95) at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.refactorResults(RenameRefactoringPlugin.java:81) at org.netbeans.modules.groovy.refactoring.findusages.FindUsagesPlugin.prepare(FindUsagesPlugin.java:85) at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:437)
Created attachment 128376 [details] stacktrace
Reproducible test case: Superclass x = new Superclass() class Superclass { } ..rename refactoring on Superclass and the NPE shows up
Ok, this is happening only in cases where the file name is the same as class declared inside. This is generally problem and makes groovy compiler complains about duplicate definition of the class. I'll improve the code to get rid of the exception but the refactoring won't work in this special case anyway.
Fixed in: web-main #ee8e34360cd5
Integrated into 'main-golden', will be available in build *201211270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/ee8e34360cd5 User: Martin Janicek <mjanicek@netbeans.org> Log: #222741 - NullPointerException at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.isAlreadyInResult