Community
Participate
Working Groups
Consider these two files: OuterClass1.java: public class OuterClass1 { private class InnerClass {} private void foo() { new InnerClass(); } } OuterClass2.java: public class OuterClass2 { } After pasting two lines from OuterClass1 into OuterClass2 the resulting OuterClass2 is: import OuterClass1.InnerClass; public class OuterClass2 { private class InnerClass {} private void foo() { new InnerClass(); } } while the expected result (we're pasting InnerClass too!) should be: public class OuterClass2 { private class InnerClass {} private void foo() { new InnerClass(); } } I understand that Eclipse tries to make sure the code refrences the same class but it should detect that code for InnerClass is pasted as well and thus the author most probably wants it to use local OuterClass2.InnerClass class instead of OuterClass1.InnerClass
*** Bug 83828 has been marked as a duplicate of this bug. ***
In addition, the import statement is bogus code in the first place. You can't import a member type (at least, eclipse gives me an error if I try).
You can import a member type, as long as it not inside a private outer type. e.g. import java.util.Map.Entry;
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Still a bug in 4.11.