mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
ensure redundant on demund imports are not created when shorten class refs would find a conflict with class in same package/implicitly imported package (IDEA-169190)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package pack2;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class Usage2 {
|
||||
int method() {
|
||||
|
||||
+12
@@ -81,6 +81,18 @@ public class ShortenClassReferencesTest extends LightCodeInsightFixtureTestCase
|
||||
"class Outer1 {class Inner {} {boolean b = new Inner() instanceof Inner;}}");
|
||||
}
|
||||
|
||||
public void testConflictingClassInSamePackage() throws Exception {
|
||||
myFixture.addClass("package p1; public class Outer{}");
|
||||
myFixture.addClass("package p2; public class Outer{}");
|
||||
myFixture.configureByText("a.java", "package p2; class Outer1 extends p1.Outer {}");
|
||||
doShortenRefs();
|
||||
myFixture.checkResult("package p2;\n" +
|
||||
"\n" +
|
||||
"import p1.Outer;\n" +
|
||||
"\n" +
|
||||
"class Outer1 extends Outer {}");
|
||||
}
|
||||
|
||||
public void testWhiteSpaceForMovedTypeAnnotations() throws Exception {
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
PsiElement elementAtCaret = myFixture.getElementAtCaret();
|
||||
|
||||
Reference in New Issue
Block a user