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.
Created attachment 144473 [details] IDE log In JavaSE project, please try to: - create a new Groovy class in package "generators" called Bara with following content: package generators class Bara { void pokus() { println "foobar" } } - in the same package, create a Groovy script file and paste c = new Bara() c.pokus(); - click on "pokus" in this script file and press Ctrl+R to refactor|rename => IDE says "The rename refactoring cannot be applied in this context" but it works if you try it from the Bara class as such Product Version: NetBeans IDE Dev (Build 201401280001) Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b66 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b125 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
It's basically done for purpose (at least it was made like this in the first -and unfortunately also the last - iteration or implementing refactoring features for Groovy). Since your declaration of "c" doesn't use any kind of static type, editor doesn't have any idea about the dynamic type it will contain when the refactoring is invoked. Because of that I can either refuse the refactoring or find all classes implementing method called "pokus" with zero parameters and ask user which one he want to use. Obviously the first solution was easier (and also faster :P) for the first refactoring, that's why I wouldn't expect this to work at the moment.