diff options
Diffstat (limited to 'java/java-tests/testData/codeInsight/daemonCodeAnalyzer')
14 files changed, 152 insertions, 2 deletions
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/IDEADEV11877.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting6/IDEADEV11877.java index 7dfc0024180f..39773bd7e428 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/IDEADEV11877.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting6/IDEADEV11877.java @@ -1,7 +1,19 @@ interface MyCloneable { //protected method from java.lang.Object is not implicitly declared in interface with no base interfaces - <error descr="'clone()' in 'MyCloneable' clashes with 'clone()' in 'java.lang.Object'; attempting to use incompatible return type">int</error> clone(); + int clone(); <error descr="'toString()' in 'MyCloneable' clashes with 'toString()' in 'java.lang.Object'; attempting to use incompatible return type">int</error> toString(); +} + +interface MyCloneable1 { + <error descr="Method does not override method from its superclass">@Override</error> + Object clone(); +} + +class MyCloneable2 { + @Override + public Object clone() { + return null; + } }
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67668.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67668.java new file mode 100644 index 000000000000..2de2b0e4f5d9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67668.java @@ -0,0 +1,17 @@ +import java.util.Collection; +import java.util.List; + +interface A +{ + <S extends Collection<?> & List<?>> void foo(S x); + <S extends List<?>> void foo(S x); +} + + +class B +{ + public static void main(String[] args) { + A a = null; + a.foo<error descr="Ambiguous method call: both 'A.foo(Collection<?>)' and 'A.foo(List<?>)' match">(null)</error>; + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67669.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67669.java new file mode 100644 index 000000000000..ed1f8df47c6f --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67669.java @@ -0,0 +1,17 @@ +import java.util.Collection; +import java.util.List; + +interface A +{ + <S extends Collection<?> & List<?>> void foo(S x); + <S extends List> String foo(S x); +} + + +class B +{ + public static void main(String[] args) { + A a = null; + char c = a.foo(null).<error descr="Cannot resolve method 'charAt(int)'">charAt</error>(0); + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67671.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67671.java new file mode 100644 index 000000000000..f066058520d1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/AmbiguousMethodCallIDEA67671.java @@ -0,0 +1,13 @@ +import java.util.Collection; +import java.util.List; + +interface A +{ + <S extends Collection<?> & List<?>> void foo(S x); +} + +<error descr="Class 'B' must either be declared abstract or implement abstract method 'foo(S)' in 'A'">class B implements A</error> +{ + public void foo(Collection<?> x) { } + public <S extends List<?> & Collection<?>> void foo(S x) { } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57500/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57500/pck/AmbiguousMethodCall.java new file mode 100644 index 000000000000..c252485568d3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousIDEA57500/pck/AmbiguousMethodCall.java @@ -0,0 +1,14 @@ +package pck; + +interface I<T> {} +interface A extends I<I<? extends String>>{} +interface B extends I<I<?>>{} + +abstract class X { + abstract <T> T foo(T x, T y); + + void bar(A x, B y){ + foo(x, y); + foo(y, y); + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/Enum.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/Enum.java index e113157c5841..89812a7ffc9d 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/Enum.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/Enum.java @@ -126,7 +126,7 @@ interface Barz { } enum Fooz implements Barz { - <error descr="Class 'Fooz' must either be declared abstract or implement abstract method 'baz()' in 'Barz'">FOO</error>; + <error descr="Class 'Fooz' must implement abstract method 'baz()' in 'Barz'">FOO</error>; } /////////////////////// diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57446.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57446.java new file mode 100644 index 000000000000..a80c4ee8f25a --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57446.java @@ -0,0 +1,7 @@ +abstract class A<T>{ + abstract void foo(T x); + class B extends A<B> { + @Override + void foo(A<T>.B x) {} + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67677.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67677.java new file mode 100644 index 000000000000..691a352f8d7d --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67677.java @@ -0,0 +1,11 @@ +import java.util.List; + +interface B<T extends Cloneable> { + void foo(List<? super T> x); +} + +class D { + void bar(B<?> x, List<?> y) { + x.foo<error descr="'foo(java.util.List<? super capture<? extends java.lang.Cloneable>>)' in 'B' cannot be applied to '(java.util.List<capture<?>>)'">(y)</error>; + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67798.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67798.java new file mode 100644 index 000000000000..dda17fdeb07f --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA67798.java @@ -0,0 +1,6 @@ +class A<T> { + { + class T extends A<T> {} + } + class T extends A<T> {} +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported.java new file mode 100644 index 000000000000..8c1beebdf0b5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported.java @@ -0,0 +1,7 @@ +import static foo.Clazz.Foo.Const_1; + +class MyObject{ + public void doIt(){ + foo.Clazz.Fo<caret>o.Const_1; + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported_after.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported_after.java new file mode 100644 index 000000000000..496ff79b3dbb --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addSingleStaticImport/AllowStaticImportWhenAlreadyImported_after.java @@ -0,0 +1,8 @@ +import static foo.Clazz.Foo; +import static foo.Clazz.Foo.Const_1; + +class MyObject{ + public void doIt(){ + Foo.Const_1; + } +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/afterImplementsInIncompleteEnumConstant.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/afterImplementsInIncompleteEnumConstant.java new file mode 100644 index 000000000000..8cee422b88a7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/afterImplementsInIncompleteEnumConstant.java @@ -0,0 +1,8 @@ +// "Implement Methods" "true" +interface Card { + void play(); +} + +enum E implements Card { + A<caret> +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/beforeImplementsInIncompleteEnumConstant.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/beforeImplementsInIncompleteEnumConstant.java new file mode 100644 index 000000000000..8cee422b88a7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implementAbstractFromNew/beforeImplementsInIncompleteEnumConstant.java @@ -0,0 +1,8 @@ +// "Implement Methods" "true" +interface Card { + void play(); +} + +enum E implements Card { + A<caret> +}
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/staticImportMethod/beforeInacceptable.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/staticImportMethod/beforeInacceptable.java new file mode 100644 index 000000000000..5648aa7c3d9b --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/staticImportMethod/beforeInacceptable.java @@ -0,0 +1,22 @@ +// "Static Import Method 'foo.B.aaaaaaa'" "false" +package foo; + +public class X { + { + foo(1, 2, <caret>aaaaaaa("")); + } + + void foo(Integer... p) {} +} + +class B { + @Deprecated + public static Integer aaaaaaa(String s, String b) { + return 1; + } +} +class B1 { + public static String aaaaaaa(String s) { + return ""; + } +}
\ No newline at end of file |