IDEA-151933 Optimize Imports can produce ambiguous code

This commit is contained in:
Alexey Kudravtsev
2016-09-07 14:12:33 +03:00
parent 4547ab27d2
commit 8b2f420ab3
17 changed files with 212 additions and 90 deletions
@@ -0,0 +1,13 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class C {
public C() {
System.out.println("com.example.bar.C init");
}
}
@@ -0,0 +1,13 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class D {
public D() {
System.out.println("com.example.bar.D init");
}
}
@@ -0,0 +1,10 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class D1 {
}
@@ -0,0 +1,10 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class D2 {
}
@@ -0,0 +1,10 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class D3 {
}
@@ -0,0 +1,10 @@
package bar;
/**
* *******************************
* Created by Irina.Petrovskaya on 8/31/2016.
* Project: untitled1
* *******************************
*/
public class D4 {
}
@@ -0,0 +1,22 @@
package foo;
import bar.*;
import static foo.B.*;
import static foo.B.C;
public class A
{
public static void main()
{
new D();
new D1();
new D2();
new D3();
new D4();
new C();
new C1();
new C2();
new C3();
}
}
@@ -0,0 +1,19 @@
package foo;
public class B
{
public static class C
{
public C() {
}
}
public static class C1
{
}
public static class C2
{
}
public static class C3
{
}
}
@@ -0,0 +1,14 @@
package x;
import x.n.X1;
import x.n.X2;
import x.n.X3;
@Deprecated
class Y {
X1 x1;
x.n.Class s;
X2 x2;
Class aclass;
X3 cc3;
}
@@ -0,0 +1,14 @@
package x;
import x.n.*;
import java.lang.Class;
@Deprecated
class Y {
X1 x1;
x.n.Class s;
X2 x2;
Class aclass;
X3 cc3;
}
@@ -0,0 +1,2 @@
package x.n;
public class Class{}
@@ -0,0 +1,4 @@
package x.n;
public class X1 {
}
@@ -0,0 +1,4 @@
package x.n;
public class X2 {
}
@@ -0,0 +1,4 @@
package x.n;
public class X3 {
}