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

“Move method” refactoring causes compilation errors in static methods #1866

Open
assdfsdafasfa opened this issue Dec 19, 2024 · 0 comments

Comments

@assdfsdafasfa
Copy link

Select the m() method in class C, select the move method refactoring, move it to class B, and a syntax error will occur.
Code before refactoring:

class B {

}
class A extends B {
    static public void m() {
    }
}
class C {
    B b;
    // move m() to B
    void m() {
    }
}

Code after refactoring:

class B {
    // move m() to B
    void m() {
    }
}
class A extends B {
    static public void m() {
    }
}
class C {
    B b;
}

Expected result (correct result): Give an error prompt before executing the refactoring

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