Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62376 Details for
Bug 169728
[1.5][compiler] WildcardBinding.boundCheck coding error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
169728.txt (text/plain), 5.16 KB, created by
Philipe Mulet
on 2007-03-29 08:04:05 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2007-03-29 08:04:05 EDT
Size:
5.16 KB
patch
obsolete
>### 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<OnlyRunnable> x1 = null; // error\n" + > " X<OnlyComparable> x2 = null; // error\n" + > " X<ComparableRunnable> x3 = null; // ok\n" + >+ " X<ComparableRunnableThrowable> 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<? extends Throwable> 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<OnlyComparable> {}\n" + >- "abstract class ComparableRunnable implements Comparable<ComparableRunnable>, Runnable {}", // ================= >+ "abstract class ComparableRunnable implements Comparable<ComparableRunnable>, Runnable {}\n" + >+ "abstract class ComparableRunnableThrowable extends Throwable implements Comparable<ComparableRunnable>, 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 <T extends Comparable<T> & Runnable> of the type X<T>\n" + > "----------\n" + >- "3. ERROR in X.java (at line 15)\n" + >+ "3. ERROR in X.java (at line 10)\n" + >+ " X<ComparableRunnableThrowable> x4 = null; // ok\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Bound mismatch: The type ComparableRunnableThrowable is not a valid substitute for the bounded parameter <T extends Comparable<T> & Runnable> of the type X<T>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 17)\n" + >+ " foo2(x1); // error\n" + >+ " ^^^^\n" + >+ "The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<OnlyRunnable>)\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 18)\n" + >+ " foo2(x2); // error\n" + >+ " ^^^^\n" + >+ "The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<OnlyComparable>)\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 19)\n" + >+ " foo2(x3); // error\n" + >+ " ^^^^\n" + >+ "The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<ComparableRunnable>)\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<capture#3-of ?> 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<capture#7-of ? extends Throwable> 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) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 169728
: 62376