Upgrade to v_C04 for Juno M1
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 cf30c8b..831ff4b 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.7.1
+Bundle-Version: 3.8.0
Bundle-ClassPath: jdtcoretestscompiler.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index 9d773de..f15f9de 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -1775,7 +1775,7 @@
" unusedLocal + unread local variable\n" +
" unusedPrivate + unused private member declaration\n" +
" unusedThrown unused declared thrown exception\n" +
- " unusedTypeArgs + unused type arguments for method\n" +
+ " unusedTypeArgs + unused type arguments for method and constructor\n" +
" uselessTypeCheck unnecessary cast/instanceof operation\n" +
" varargsCast + varargs argument need explicit cast\n" +
" warningToken + unsupported or unnecessary @SuppressWarnings\n" +
@@ -9108,6 +9108,35 @@
"1 problem (1 warning)",
true);
}
+//-warn option - regression tests
+public void test230_warn_options() {
+ // same source as 190, skip check defaults
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "import java.util.ArrayList;\n" +
+ "public class X<T>{\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public X(T t){}\n" +
+ " void foo() {\n" +
+ " X<String> x = new X<String>();\n" +
+ " X<Number> x1 = new X<Number>(1);\n" +
+ " }\n" +
+ "}\n"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "X.java\""
+ + " -warn:unusedTypeArgs -proc:none -1.7 -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
+ " X<String> x = new X<String>();\n" +
+ " ^\n" +
+ "Redundant specification of type arguments <String>\n" +
+ "----------\n" +
+ "1 problem (1 warning)",
+ true);
+}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=216684
// .java/.class files precedence depending on sourcepath and other conditions
// ecj always selects source files from the sourcepath over class files
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
index 052bbc1..cef41ac 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1869,6 +1869,511 @@
"----------\n"
);
}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test051() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " boolean y = (boolean) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " boolean y = (boolean) x;\n" +
+ " ^^^^^^^^^^^\n" +
+ "Cannot cast from Object to boolean\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "true"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test052() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " byte y = (byte) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Byte((byte)1);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " byte y = (byte) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to byte\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "1"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test053() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " char y = (char) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Character('d');\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " char y = (char) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to char\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "d"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+// Also confirm that a check cast and unboxing conversion are generated.
+public void test054() throws Exception {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " int y = (int) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Integer(1);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "1"
+ );
+ String expectedOutput =
+ " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
+ " // Stack: 2, Locals: 3\n" +
+ " public static void main(java.lang.String[] args);\n" +
+ " 0 invokestatic X.foo() : java.lang.Object [16]\n" +
+ " 3 astore_1 [x]\n" +
+ " 4 aload_1 [x]\n" +
+ " 5 checkcast java.lang.Integer [20]\n" +
+ " 8 invokevirtual java.lang.Integer.intValue() : int [22]\n" +
+ " 11 istore_2 [y]\n" +
+ " 12 getstatic java.lang.System.out : java.io.PrintStream [26]\n" +
+ " 15 iload_2 [y]\n" +
+ " 16 invokevirtual java.io.PrintStream.println(int) : void [32]\n" +
+ " 19 return\n" +
+ " Line numbers:\n" +
+ " [pc: 0, line: 3]\n" +
+ " [pc: 4, line: 4]\n" +
+ " [pc: 12, line: 5]\n" +
+ " [pc: 19, line: 6]\n" +
+ " Local variable table:\n" +
+ " [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[]\n" +
+ " [pc: 4, pc: 20] local: x index: 1 type: java.lang.Object\n" +
+ " [pc: 12, pc: 20] local: y index: 2 type: int\n" +
+ " \n";
+ File f = new File(OUTPUT_DIR + File.separator + "X.class");
+ byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
+ ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+ String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
+ int index = result.indexOf(expectedOutput);
+ if (index == -1 || expectedOutput.length() == 0) {
+ System.out.println(Util.displayString(result, 3));
+ }
+ if (index == -1) {
+ assertEquals("Wrong contents", expectedOutput, result);
+ }
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test055() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " long y = (long) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Long(Long.MAX_VALUE);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " long y = (long) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to long\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "9223372036854775807"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test056() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " short y = (short) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Short((short) 1);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " short y = (short) x;\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot cast from Object to short\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "1"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test057() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " double y = (double) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Double(1.0);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " double y = (double) x;\n" +
+ " ^^^^^^^^^^\n" +
+ "Cannot cast from Object to double\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "1.0"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test058() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " float y = (float) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Float(1.0f);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " float y = (float) x;\n" +
+ " ^^^^^^^^^\n" +
+ "Cannot cast from Object to float\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "1.0"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test059() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
+ " int y = (int) x;\n" +
+ " } catch (ClassCastException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAIL\");\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return new Float(1.0f);\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "SUCCESS"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test059b() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
+ " int y = (int) x;\n" +
+ " } catch (ClassCastException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAIL\");\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " int y = (int) x;\n" +
+ " ^^^^^^^\n" +
+ "Cannot cast from Object to int\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "SUCCESS"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test059c() {
+ CompilerOptions options = new CompilerOptions(getCompilerOptions());
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
+ " char y = (char) x;\n" +
+ " } catch (ClassCastException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAIL\");\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
+ "}";
+ if (options.sourceLevel < ClassFileConstants.JDK1_7) {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " char y = (char) x;\n" +
+ " ^^^^^^^^\n" +
+ "Cannot cast from Object to char\n" +
+ "----------\n"
+ );
+ } else {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "SUCCESS"
+ );
+ }
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test060() {
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " Boolean y = (Boolean) x;\n" +
+ " System.out.println(y);\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
+ "}";
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "true"
+ );
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353085
+public void test061() {
+ String source =
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " Object x = foo();\n" +
+ " try {\n" +
+ " Float y = (Float) x;\n" +
+ " } catch (ClassCastException e) {\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " return;\n" +
+ " }\n" +
+ " System.out.println(\"FAIL\");\n" +
+ " }\n" +
+ " public static Object foo() {\n" +
+ " return Boolean.TRUE;\n" +
+ " }\n" +
+ "}";
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ source
+ },
+ "SUCCESS"
+ );
+}
public static Class testClass() {
return CastTest.class;
}
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 241c2aa..0c2d97e 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
@@ -12328,4 +12328,112 @@
"The method f(String) is ambiguous for the type B<String>\n" +
"----------\n");
}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353089
+public void test353089() throws Exception {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "import java.util.*;\n" +
+ "interface A {\n" +
+ "int get(List<String> l);\n" +
+ "}\n" +
+ "interface B {\n" +
+ "int get(List<Integer> l);\n" +
+ "}\n" +
+ "interface C extends A, B { \n" +
+ "int get(List l); // name clash error here\n" +
+ "}\n" +
+ "public class X {\n" +
+ " public static void main(String [] args) {\n" +
+ " System.out.println(\"Built OK\");\n" +
+ " }\n" +
+ "}"
+ },
+ "Built OK");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353089
+public void test353089b() throws Exception {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ "import java.util.List;\n" +
+ "interface I {\n" +
+ " void a(List<String> i, List<String> j);\n" +
+ " void b(List<String> i, List<String> j);\n" +
+ " void c(List i, List<String> j);\n" +
+ "}\n" +
+ "interface X extends I {\n" +
+ " public void a(List<String> i, List j);\n" +
+ " public void b(List i, List j);\n" +
+ " public void c(List i, List j);\n" +
+ " public void d(Zork z);\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. WARNING in X.java (at line 5)\n" +
+ " void c(List i, List<String> j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 8)\n" +
+ " public void a(List<String> i, List j);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method a(List<String>, List) of type X has the same erasure as a(List<String>, List<String>) of type I but does not override it\n" +
+ "----------\n" +
+ "3. WARNING in X.java (at line 8)\n" +
+ " public void a(List<String> i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "4. WARNING in X.java (at line 9)\n" +
+ " public void b(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "5. WARNING in X.java (at line 9)\n" +
+ " public void b(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "6. WARNING in X.java (at line 10)\n" +
+ " public void c(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "7. WARNING in X.java (at line 10)\n" +
+ " public void c(List i, List j);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 11)\n" +
+ " public void d(Zork z);\n" +
+ " ^^^^\n" +
+ "Zork cannot be resolved to a type\n" +
+ "----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=353089
+public void test353089c() throws Exception {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ "import java.util.List;\n" +
+ "interface IFtest {\n" +
+ " public void doTest(Integer i, List<String> pList, List<String> pList2);\n" +
+ "}\n" +
+ "interface Impl extends IFtest {\n" +
+ " public void doTest(Integer i, List<String> iList, List iList2);\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " public void doTest(Integer i, List<String> iList, List iList2);\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method doTest(Integer, List<String>, List) of type Impl has the same erasure as doTest(Integer, List<String>, List<String>) of type IFtest but does not override it\n" +
+ "----------\n" +
+ "2. WARNING in X.java (at line 6)\n" +
+ " public void doTest(Integer i, List<String> iList, List iList2);\n" +
+ " ^^^^\n" +
+ "List is a raw type. References to generic type List<E> should be parameterized\n" +
+ "----------\n");
+}
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
index c56f34a..de0e7c6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
@@ -6778,4 +6778,28 @@
true,
customOptions);
}
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=354052
+ public void test054() throws Exception {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ "public static void foo() {\n" +
+ " X z;\n" +
+ " while ((z = getObject()) != null) {\n" +
+ " z.bar();\n" +
+ " }\n" +
+ " System.out.println(\"SUCCESS\");\n" +
+ " }\n" +
+ " public void bar() {}\n" +
+ " public static X getObject() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n"+
+ " new X().foo();\n"+
+ " }\n"+
+ "}",
+ },
+ "SUCCESS");
+ }
}