netbeans
netbeans copied to clipboard
Renaming Local Variables Leads to Changes in Code Behavior
Apache NetBeans version
Apache NetBeans 23
What happened
When the "variabeToBeRenamed" is selected for the rename variable refactoring, code before refactoring, "variable" variable assigned to "fieldToBeRenamed" field;
class SourceClass{ int variableToBeRenamed = 1; class InnerClass{ int field = 0; void method(){ field = variableToBeRenamed ; } } }
Language / Project Type / NetBeans Component
No response
How to reproduce
When the "variabeToBeRenamed" is selected for the rename variable refactoring, code before refactoring, "variable" variable assigned to "fieldToBeRenamed" field;
class SourceClass{ int variableToBeRenamed = 1; class InnerClass{ int field = 0; void method(){ field = variableToBeRenamed ; } } }
Did this work correctly in an earlier version?
Apache NetBeans 23
Operating System
Windows11
JDK
20
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No