netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Renaming Local Variables Leads to Changes in Code Behavior

Open assdfsdafasfa opened this issue 1 year ago • 0 comments

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

assdfsdafasfa avatar Oct 08 '24 13:10 assdfsdafasfa