eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
37 stars 90 forks source link

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

Closed DongChunHao closed 2 months ago

DongChunHao commented 3 months ago

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 commented 3 months ago

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