Please use the Apache issue tracking system for new NetBeans issues ( !!

Bug 222741

Summary: NullPointerException at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.isAlreadyInResult
Product: groovy Reporter: Martin Janicek <mjanicek>
Component: RefactoringAssignee: Martin Janicek <mjanicek>
Status: RESOLVED FIXED QA Contact: issues <>
Priority: P3    
Version: 7.3   
Target Milestone: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Report: 195683
Attachments: stacktrace

Description Martin Janicek 2012-11-26 09:17:59 UTC
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

   at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.isAlreadyInResult(
   at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.addModificationToResult(
   at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.collectModifications(
   at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.refactorResults(
   at org.netbeans.modules.groovy.refactoring.findusages.FindUsagesPlugin.prepare(
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(
Comment 1 Martin Janicek 2012-11-26 09:18:01 UTC
Created attachment 128376 [details]
Comment 2 Martin Janicek 2012-11-26 09:20:27 UTC
Reproducible test case:

Superclass x = new Superclass()

class Superclass {

..rename refactoring on Superclass and the NPE shows up
Comment 3 Martin Janicek 2012-11-26 10:17:22 UTC
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.
Comment 4 Martin Janicek 2012-11-26 10:22:47 UTC
Fixed in: web-main #ee8e34360cd5
Comment 5 Quality Engineering 2012-11-27 02:56:51 UTC
Integrated into 'main-golden', will be available in build *201211270002* on (upload may still be in progress)
User: Martin Janicek <>
Log: #222741 - NullPointerException at org.netbeans.modules.groovy.refactoring.rename.RenameRefactoringPlugin.isAlreadyInResult
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo