### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.606 diff -u -r1.606 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 28 Mar 2007 13:46:25 -0000 1.606 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 29 Mar 2007 12:02:37 -0000 @@ -37108,6 +37108,7 @@ }, ""); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=169728 public void test1119() { this.runNegativeTest( new String[] { @@ -37121,18 +37122,35 @@ " X x1 = null; // error\n" + " X x2 = null; // error\n" + " X x3 = null; // ok\n" + + " X x4 = null; // ok\n" + + " \n" + + " foo1(x1); // ok\n" + + " foo1(x2); // ok\n" + + " foo1(x3); // ok\n" + + " foo1(x4); // ok\n" + + "\n" + + " foo2(x1); // error\n" + + " foo2(x2); // error\n" + + " foo2(x3); // error\n" + + " foo2(x4); // ok\n" + " }\n" + " \n" + - " void foo(X x) {\n" + - " x.get().run();\n" + - " x.get().compareTo(null);\n" + + " static void foo1(X x) {\n" + + " x.get().run(); // ok\n" + + " x.get().compareTo(null); // ok\n" + " x.get().compareTo(x.get()); // error\n" + " }\n" + + " static void foo2(X x) {\n" + + " x.get().run(); // ok\n" + + " x.get().compareTo(null); // ok\n" + + " x.get().compareTo(x.get()); // error\n" + + " } \n" + "}\n" + "\n" + "abstract class OnlyRunnable implements Runnable {}\n" + "abstract class OnlyComparable implements Comparable {}\n" + - "abstract class ComparableRunnable implements Comparable, Runnable {}", // ================= + "abstract class ComparableRunnable implements Comparable, Runnable {}\n" + + "abstract class ComparableRunnableThrowable extends Throwable implements Comparable, Runnable {}", // ================= }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + @@ -37145,10 +37163,35 @@ " ^^^^^^^^^^^^^^\n" + "Bound mismatch: The type OnlyComparable is not a valid substitute for the bounded parameter & Runnable> of the type X\n" + "----------\n" + - "3. ERROR in X.java (at line 15)\n" + + "3. ERROR in X.java (at line 10)\n" + + " X x4 = null; // ok\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Bound mismatch: The type ComparableRunnableThrowable is not a valid substitute for the bounded parameter & Runnable> of the type X\n" + + "----------\n" + + "4. ERROR in X.java (at line 17)\n" + + " foo2(x1); // error\n" + + " ^^^^\n" + + "The method foo2(X) in the type X is not applicable for the arguments (X)\n" + + "----------\n" + + "5. ERROR in X.java (at line 18)\n" + + " foo2(x2); // error\n" + + " ^^^^\n" + + "The method foo2(X) in the type X is not applicable for the arguments (X)\n" + + "----------\n" + + "6. ERROR in X.java (at line 19)\n" + + " foo2(x3); // error\n" + + " ^^^^\n" + + "The method foo2(X) in the type X is not applicable for the arguments (X)\n" + + "----------\n" + + "7. ERROR in X.java (at line 26)\n" + " x.get().compareTo(x.get()); // error\n" + " ^^^^^^^^^\n" + "The method compareTo(capture#3-of ?) in the type Comparable is not applicable for the arguments (capture#4-of ?)\n" + + "----------\n" + + "8. ERROR in X.java (at line 31)\n" + + " x.get().compareTo(x.get()); // error\n" + + " ^^^^^^^^^\n" + + "The method compareTo(capture#7-of ? extends Throwable) in the type Comparable is not applicable for the arguments (capture#8-of ? extends Throwable)\n" + "----------\n"); } } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java,v retrieving revision 1.61 diff -u -r1.61 WildcardBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 16 Mar 2007 18:28:58 -0000 1.61 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 29 Mar 2007 12:02:38 -0000 @@ -55,7 +55,7 @@ } /** - * Returns true if the argument type satisfies all bounds of the type parameter + * Returns true if the argument type satisfies the wildcard bound(s) */ public boolean boundCheck(TypeBinding argumentType) { switch (this.boundKind) {