Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming fields causes conflicts with parameter naming, resulting in changes in code behavior #3614

Open
DongChunHao opened this issue Apr 25, 2024 · 0 comments

Comments

@DongChunHao
Copy link

[provide a description of the issue]

Environment
  • Operating System:
  • JDK version:
  • Visual Studio Code version:
  • Java extension version:
Steps To Reproduce

1.select "originalField"
2.click “Rename”
3. new name "originalFieldRenamed"

class AnotherClass {
// rename originalFieldRenamed
int originalField = 20;

public void anotherMethod(int originalFieldRenamed) {
int localVar = originalFieldRenamed; // Local variable with the same name as the field
System.out.println(originalField);
}
}

refactoring result:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant