Closed DongChunHao closed 1 month ago
@jjohnstn Please help me to confirm whether this is a bug, thank you
@DongChunHao It is a definite behavior change. The question is whether the code should prevent you from all harm or whether it is doing what you asked it to do and there may be consequences. It often depends on how common the scenario is and how efficiently it can be detected. In this case it would require finding all extenders of B and their subclasses that reference a method m() from an outer class. I will take a look.
@DongChunHao I was able to create a fix that seems to perform reasonably.
Select the m() method in class A and reconstruct the moving method into class B. As a result, class C.m() is called in the method() method in class D before refactoring, and B.m() is called after refactoring, and the code behavior changes. The code before refactoring is as follows:
The resulting code after refactoring is as follows: