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

Bug: Performing the extract method refactoring results in a change in code behavior #1516

Closed
DongChunHao opened this issue Jul 17, 2024 · 1 comment · Fixed by #1576
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@DongChunHao
Copy link
Contributor

When the 21-line statement in class B is selected to perform extraction method refactoring, the new method is named 'f', resulting in changes in code behavior, that is, before refactoring, the method() in class C is called f() in class C, and after refactoring, the method() in class B is called f() in class B. Before refactoring, the code is as follows:

image

The resulting code after refactoring is as follows:

image

@DongChunHao
Copy link
Contributor Author

@jjohnstn Please help me to confirm whether this is a bug, thank you

@jjohnstn jjohnstn self-assigned this Aug 8, 2024
@jjohnstn jjohnstn added the bug Something isn't working label Aug 8, 2024
@jjohnstn jjohnstn added this to the 4.33 M3 milestone Aug 8, 2024
jjohnstn added a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue Aug 8, 2024
- modify ExtractMethodRefactoring to test if the new method name
  collides with an existing method name being used by a class that
  sub-classes the one creating the new method
- add new test to ExtractMethodtests
- fixes eclipse-jdt#1516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants