eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
"Pull up method" refactoring: Behavior changes in inheritance relationships
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 35
Description
Select m() in class C, and click Pull up refactoring, resulting in changes to the call relationship in the f() method.
Code before refactoring:
```java
class A {
void m(Object m) {
System.out.println("A");
}
}
class B extends A {
void k(String m) {
System.out.println("B");
}
void f() {
m("1");
}
}
class C extends B{
// pull up ‘m’
void m(String m) {
System.out.println("B");
}
}
```
Code after refactoring:
```java
class A {
void m(Object m) {
System.out.println("A");
}
}
class B extends A {
void k(String m) {
System.out.println("B");
}
void f() {
m("1");
}
// pull up ‘m’
void m(String m) {
System.out.println("B");
}
}
class C extends B{
}
```
Contributor guide
Research direction
Reproduce the Pull up refactoring with the Java classes A, B, and C shown in the issue, focusing on the call to m("1") in B.f(). Start from the Pull up refactoring entry point and compare the call relationship before and after; done means pulling m(String) from C does not change that relationship unexpectedly.
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
- Mostly clear
- Newbie friendliness
- 35/100