History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-13642
Type: Bug Bug
Status: Open Open
Assignee: Alexey Kudravtsev
Reporter: Sergei Ivanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

"Extract Superclass" corrupts imports

Created: 09 Jul 07 15:38   Updated: 09 Jul 07 20:35
Component/s: Refactoring

Build: 7,041
Severity: Medium


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.