eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

“Move method” refactoring causes compilation errors in static methods

Open
#1,866 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
23h 30m
Merged PRs (30d)
35

Description

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:
```java
class B {

}
class A extends B {
static public void m() {
}
}
class C {
B b;
// move m() to B
void m() {
}
}
```
Code after refactoring:
```java
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

Contributor guide

Open the contributing guide

Research direction

Start with the Move method refactoring entry point and reproduce the Java example by moving m() from C to B when A extends B. Compare the resulting syntax error with the expected behavior; done means the refactoring is rejected with an error prompt before it executes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.