update jdt.core & tests to I20130911-2000
diff --git a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
index 50ad2b4..6253b9d 100644
--- a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core.tests.compiler
-Bundle-Version: 3.8.3
+Bundle-Version: 3.9.0
Bundle-ClassPath: jdtcoretestscompiler.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index 9b3bc2f..d36391b 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -12,12 +12,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>eclipse.jdt.core</artifactId>
+ <artifactId>tests-pom</artifactId>
<groupId>eclipse.jdt.core</groupId>
<version>4.4.0-SNAPSHOT</version>
+ <relativePath>../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core.tests.compiler</artifactId>
- <version>3.8.3-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
+ <version>3.9.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
+ </properties>
+
</project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
index bcc0eb7..a10fc72 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
@@ -14,6 +14,7 @@
* bug 405706 - Eclipse compiler fails to give compiler error when return type is a inferred generic
* Bug 408441 - Type mismatch using Arrays.asList with 3 or more implementations of an interface with the interface type as the last parameter
* Bug 413958 - Function override returning inherited Generic Type
+ * Bug 415734 - Eclipse gives compilation error calling method with an inferred generic return type
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
@@ -3266,4 +3267,29 @@
"Type mismatch: cannot convert from ReadOnlyWrapper<TestA,TestB> to WritableWrapper<TestA2,TestB>\n" +
"----------\n");
}
+public void testBug415734() {
+ runNegativeTest(
+ new String[] {
+ "Compile.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "public class Compile {\n" +
+ "\n" +
+ " public <T, Exp extends List<T>> Exp typedNull() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "\n" +
+ " public void call() {\n" +
+ " ArrayList<String> list = typedNull();\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in Compile.java (at line 11)\n" +
+ " ArrayList<String> list = typedNull();\n" +
+ " ^^^^^^^^^^^\n" +
+ "Type mismatch: cannot convert from List<Object> to ArrayList<String>\n" +
+ "----------\n");
+}
}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
index b8ad03f..c1d7514 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
@@ -11,6 +11,7 @@
* bug 388795 - [compiler] detection of name clash depends on order of super interfaces
* bug 395681 - [compiler] Improve simulation of javac6 behavior from bug 317719 after fixing bug 388795
* bug 409473 - [compiler] JDT cannot compile against JRE 1.8
+ * Bug 410325 - [1.7][compiler] Generified method override different between javac and eclipse compiler
* Andy Clement - Contribution for
* bug 406928 - computation of inherited methods seems damaged (affecting @Overrides)
*******************************************************************************/
@@ -13839,4 +13840,94 @@
"public abstract class Foo<E> implements java.util.List<E> { } "
});
}
+// https://bugs.eclipse.org/410325 - [1.7][compiler] Generified method override different between javac and eclipse compiler
+public void testBug410325() {
+ runConformTest(
+ new String[] {
+ "Main.java",
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " F3 f3 = new F3();\n" +
+ " SubSub sub = new SubSub();\n" +
+ " sub.foo(f3);\n" +
+ "\n" +
+ " Sub<F3> sub2 = sub;\n" +
+ " Base<F3> base = sub;\n" +
+ " sub2.foo(f3);\n" +
+ " base.foo(f3);\n" +
+ "\n" +
+ " F2 f2 = new F2();\n" +
+ " sub2.foo(f2);\n" +
+ " }\n" +
+ "\n" +
+ " public static class F1 {\n" +
+ " }\n" +
+ "\n" +
+ " public static class F2 extends F1 {\n" +
+ " }\n" +
+ "\n" +
+ " public static class F3 extends F2 {\n" +
+ " public void bar() {\n" +
+ " System.out.println(\"bar in F3\");\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class Base<T extends F1> {\n" +
+ " public abstract void foo(T bar);\n" +
+ " }\n" +
+ "\n" +
+ " public static abstract class Sub<T extends F2> extends Base<T> {\n" +
+ " @Override\n" +
+ " public void foo(F2 bar) {\n" +
+ " System.out.println(getClass().getSimpleName() + \": F2 + \"\n" +
+ " + bar.getClass().getSimpleName());\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public static class SubSub extends Sub<F3> {\n" +
+ " }\n" +
+ "}"
+ });
+}
+// https://bugs.eclipse.org/410325 - [1.7][compiler] Generified method override different between javac and eclipse compiler
+// test from duplicate bug 411811
+public void testBug411811() {
+ runConformTest(
+ new String[] {
+ "FaultyType.java",
+ " class ParamType {}\n" +
+ "\n" +
+ " abstract class AbstractType<T extends ParamType> {\n" +
+ " public abstract void foo(T t);\n" +
+ " }\n" +
+ "\n" +
+ " abstract class SubAbstractType<T extends ParamType> extends AbstractType<T> {\n" +
+ " @Override public void foo(ParamType t) {}\n" +
+ " }\n" +
+ "\n" +
+ " class SubParamType extends ParamType {}\n" +
+ " \n" +
+ "public class FaultyType extends SubAbstractType<SubParamType> {}"
+ });
+}
+// https://bugs.eclipse.org/410325 - [1.7][compiler] Generified method override different between javac and eclipse compiler
+// test from duplicate bug 415600
+public void testBug415600() {
+ runConformTest(
+ new String[] {
+ "A.java",
+ "import java.io.Reader;\n" +
+ "import java.io.StringReader;\n" +
+ "\n" +
+ "public abstract class A<E extends Reader> {\n" +
+ " protected abstract void create(E element);\n" +
+ "}\n" +
+ "\n" +
+ "abstract class B<T extends Reader> extends A<T> {\n" +
+ " public void create(Reader element) { }\n" +
+ "}\n" +
+ "\n" +
+ "class C extends B<StringReader> { }\n"
+ });
+}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
index d0f020c..2b58996 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
@@ -7,6 +7,9 @@
*
* Contributors:
* Stephan Herrmann - initial API and implementation
+ * Till Brychcy <register.eclipse@brychcy.de> - Contribution for
+ * Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+ * Bug 415269 - [compiler][null] NonNullByDefault is not always inherited to nested classes
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
@@ -6229,4 +6232,221 @@
options,
"");
}
+
+public void testBug413460() {
+ runConformTestWithLibs(
+ new String[] {
+ "Class2.java",
+ "\n" +
+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" +
+ "public class Class2 {\n" +
+ " public class Class3 {\n" +
+ " public Class3(String nonNullArg) {\n" +
+ " assert nonNullArg != null;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " public Class2(String nonNullArg) {\n" +
+ " assert nonNullArg != null;\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2 create(String nonNullArg) {\n" +
+ " return new Class2(nonNullArg);\n" +
+ " }\n" +
+ "}\n"
+ },
+ getCompilerOptions(),
+ "");
+ runNegativeTestWithLibs(false,
+ new String[] {
+ "Class1.java",
+ "public class Class1 {\n" +
+ " public static Class2 works() {\n" +
+ " return Class2.create(null);\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2 bug() {\n" +
+ " return new Class2(null);\n" +
+ " }\n" +
+ "\n" +
+ " public static Class2.Class3 qualifiedbug() {\n" +
+ " return new Class2(\"\").new Class3(null);\n" +
+ " }\n" +
+ "}\n"
+ },
+ getCompilerOptions(),
+ "----------\n" +
+ "1. ERROR in Class1.java (at line 3)\n" +
+ " return Class2.create(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "2. ERROR in Class1.java (at line 7)\n" +
+ " return new Class2(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n" +
+ "3. ERROR in Class1.java (at line 11)\n" +
+ " return new Class2(\"\").new Class3(null);\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" +
+ "----------\n");
+}
+// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+public void testBug415413() {
+ Map options = getCompilerOptions();
+ runNegativeTestWithLibs(
+ new String[]{
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " Object o = null;\n" +
+ " needNonNull(o);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+ options,
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n");
+}
+// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+// Variant: non-null before the loop and at the end of the loop body
+public void testBug415413a() {
+ Map options = getCompilerOptions();
+ runConformTestWithLibs(
+ new String[]{
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = new Object();\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " needNonNull(o);\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+ options,
+ "");
+}
+// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+// Variant: null before the loop and non-null at the end of the loop body
+public void testBug415413b() {
+ Map options = getCompilerOptions();
+ runNegativeTestWithLibs(
+ new String[]{
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = null;\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " needNonNull(o);\n" +
+ " o = new Object();\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+ options,
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n");
+}
+// Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+// Variant: non-null before the loop and null at the end of the loop body
+public void testBug415413c() {
+ Map options = getCompilerOptions();
+ runNegativeTestWithLibs(
+ new String[]{
+ "ClassF.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "public class ClassF {\n" +
+ " public static void needNonNull(@NonNull Object o) {\n" +
+ " o.hashCode();\n" +
+ " }\n" +
+ " public void method() {\n" +
+ " for (int j = 0; j < 1; j++) {\n" +
+ " try {\n" +
+ " this.hashCode();\n" +
+ " } finally {\n" +
+ " Object o = new Object();\n" +
+ " for (int i = 0; i < 1; i++) {\n" +
+ " needNonNull(o);\n" +
+ " o = null;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+ options,
+ "----------\n" +
+ "1. ERROR in ClassF.java (at line 13)\n" +
+ " needNonNull(o);\n" +
+ " ^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is inferred as @Nullable\n" +
+ "----------\n");
+}
+public void testBug_415269() {
+ Map options = getCompilerOptions();
+ runConformTestWithLibs(
+ new String[]{
+ "Y.java",
+ "import org.eclipse.jdt.annotation.NonNull;\n"+
+ "public class Y {\n"+
+ " public static class C implements X.I {\n"+
+ " public void method(@NonNull Object arg) {\n"+
+ " }\n"+
+ " }\n"+
+ "}\n",
+ "X.java",
+ "import org.eclipse.jdt.annotation.NonNullByDefault;\n"+
+ "@NonNullByDefault\n"+
+ "public class X {\n"+
+ " public interface I {\n"+
+ " public void method(Object arg);\n"+
+ " }\n"+
+ "}\n"
+ },
+ options,
+ "");
+}
}