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

“Pull up method refactoring”: The method call relationship has changed

Open
#1,870 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 fool1() in class A, and click Pull up refactoring, resulting in a compilation error.

Code before refactoring:
```java
class RenameTest {
static void foo1(Number n) {
System.out.println("1");
}
public static void main(String[] args) {
long n = 0;
foo1(n);// look here
}
}
class A extends RenameTest {
// pull up
void foo1(Long i) {
System.out.println("2");
}
}
```
Code after refactoring:
```java
class RenameTest {
static void foo1(Number n) {
System.out.println("1");
}
public static void main(String[] args) {
long n = 0;
foo1(n);// look here
}
// pull up foo1
void foo1(Long i) {
System.out.println("2");
}
}
class A extends RenameTest {
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the Pull up refactoring with the Java snippets in the issue and confirm the changed method-call relationship and compilation error. Then locate the Pull up refactoring entry point and add a regression test covering the overloaded foo1 methods, with completion defined as valid compilation and preserved call behavior.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.