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.
When refactoring/renaming a public member variable in Java, references to that variable in other classes will insert "Class.this" between the object reference and the variable name if the new variable name matches a local variable name in the other class. Example when "public int id" in ClassB is renamed from "id" to "idnum": Before refactor: After refactor: | | | /* ClassA.java */ | /* ClassA.java */ | public class ClassA { | public class ClassA { | public void methodA() { | public void methodA() { | ClassB bObj = new ClassB(); | ClassB bObj = new ClassB(); | int idnum = 5; | int idnum = 5; | bObj.id = idnum; | bObj.ClassB.this.idnum = idnum; | } | } | } | } | /* ClassB.java */ | /* ClassB.java */ | public class ClassB { | public class ClassB { | public int id; | public int idnum; | public ClassB() { | public ClassB() { | this.id = 1; | this.idnum = 1; | } | } | } | } This issue does not appear to occur when the new variable name does not match a local variable name in another class.