Here is a small example that shows the problem:
----------- a/b/Foo.java ------------
package a.b;
public class Foo {
}
----------- a/b/FooFactoryB.java ------------
package a.b;
public class FooFactoryB {
public static Foo getFoo() {
return new Foo();
}
}
----------- a/Foo.java ------------
package a;
public class Foo {
}
----------- a/FooFactoryA.java ------------
package a;
public class FooFactoryA {
public static Foo getFoo() { return new Foo(); } }
}
----------- a/Bar.java ------------
package a;
import a.b.FooFactoryB;
public class Bar {
public static void main(String[] args) {
Foo aFoo = FooFactoryA.getFoo();
Foo foo = FooFactoryB.getFoo();
}
}
---------------------------------------
Now, in Bar.java, you will see the second statement in main underlined. The intention says 'Change 'foo' type to 'a.b.Foo'. When I select it, this is what happens:
package a;
import a.b.*;
import a.b.Foo;
public class Bar {
public static void main(String[] args) { Foo aFoo = FooFactoryA.getFoo(); Foo foo = FooFactoryB.getFoo(); } }
}
---------------------------------------------------
Which basically messes up the imports for the original Foo class. Also, in my code style I specified only to use the wildcard when there are 99 imports from the same package, so I'm not sure whats going on here. In my real world example, this is really annoying since I have a lot of references to the original class, and I have to use the local history to revert the changes to the imports.