package test.x.p1;
public class A {
public void m1() {
}
public void m2() {
}
}
"test/x/p2/B.java"
package test.x.p2;
import test.x.p1.A;
public class B {
A a;
void foo() {
a.m1();
}
}
"test/x/p2/C.java"
package test.x.p2;
import test.x.p1.A;
public class C {
A a;
void foo() {
a.m2();
}
}
Action:
Extract superclass, rename original class to AA, select m1() to be put into the superclass.
Result: all correct for A, AA and C, imports are corrupted for B:
"test/x/p2/B.java"
package test.x.p2;
public class B {
A a; // <---- unresolved class name A
void foo() {
a.m1();
}
}
Import for A is removed from B, while it should have been retained.
Description
Initial set-up:
"test/x/p1/A.java"
package test.x.p1;
public class A {
public void m1() {
}
public void m2() {
}
}
"test/x/p2/B.java"
package test.x.p2;
import test.x.p1.A;
public class B {
A a;
void foo() {
a.m1();
}
}
"test/x/p2/C.java"
package test.x.p2;
import test.x.p1.A;
public class C {
A a;
void foo() {
a.m2();
}
}
Action:
Extract superclass, rename original class to AA, select m1() to be put into the superclass.
Result: all correct for A, AA and C, imports are corrupted for B:
"test/x/p2/B.java"
package test.x.p2;
public class B {
A a; // <---- unresolved class name A
void foo() {
a.m1();
}
}
Import for A is removed from B, while it should have been retained.