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 70148 Details for
Bug 189933
[compiler][1.5] extraneous ambiguous constructor error on generics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Correct updated patch
patch.txt (text/plain), 4.99 KB, created by
Kent Johnson
on 2007-06-05 11:13:46 EDT
(
hide
)
Description:
Correct updated patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2007-06-05 11:13:46 EDT
Size:
4.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.309 >diff -u -r1.309 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 24 May 2007 14:29:32 -0000 1.309 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 5 Jun 2007 15:12:42 -0000 >@@ -2581,7 +2581,7 @@ > if (oneParam.isCompatibleWith(twoParam)) { > if (oneParam.leafComponentType().isRawType()) { > // A#RAW is not more specific than a rawified A<T> >- if (oneParam.needsUncheckedConversion(two.original().parameters[i])) >+ if (oneParam.needsUncheckedConversion(two.declaringClass.isRawType() ? twoParam : two.original().parameters[i])) > return false; > } > } else { >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java,v >retrieving revision 1.46 >diff -u -r1.46 AmbiguousMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 30 May 2007 14:55:43 -0000 1.46 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 5 Jun 2007 15:12:44 -0000 >@@ -2090,59 +2090,79 @@ > "----------\n" > ); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=191029 >+public void test059a() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "import java.util.TreeMap;\n" + >+ "class X {\n" + >+ " void test(TreeMap<String, Object> tm) {\n" + >+ " TreeMap copy = new TreeMap(tm);\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 4)\n" + >+ " TreeMap copy = new TreeMap(tm);\n" + >+ " ^^^^^^^\n" + >+ "TreeMap is a raw type. References to generic type TreeMap<K,V> should be parameterized\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 4)\n" + >+ " TreeMap copy = new TreeMap(tm);\n" + >+ " ^^^^^^^^^^^^^^^\n" + >+ "Type safety: The constructor TreeMap(SortedMap) belongs to the raw type TreeMap. References to generic type TreeMap<K,V> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 4)\n" + >+ " TreeMap copy = new TreeMap(tm);\n" + >+ " ^^^^^^^\n" + >+ "TreeMap is a raw type. References to generic type TreeMap<K,V> should be parameterized\n" + >+ "----------\n" >+ ); >+} > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933 >-public void _test060() { >+public void test060() { > this.runConformTest( > new String[] { > "X.java", > "public class X<T> {\n" + >- " public void bar(K<T, Object> p) {\n" + >- " new Y(p);\n" + >- " new Y((J<T, Object>) p);\n" + >- " new Y((I<T, Object>) p);\n" + >- " }\n" + >+ " public void bar(K<T, Object> p) {\n" + >+ " new Y(p);\n" + >+ " new Y((J<T, Object>) p);\n" + >+ " new Y((I<T, Object>) p);\n" + >+ " }\n" + > "}\n" + > "class Y<T, U> {\n" + >- " Y(I<? extends T, ? extends U> p) {\n" + >- " }\n" + >- " Y(J<T, ? extends U> p) {\n" + >- " }\n" + >- "}\n" + >- "interface I<T, U> { \n" + >- "}\n" + >- "interface J<T, U> extends I<T, U> {\n" + >+ " Y(I<? extends T, ? extends U> p) {}\n" + >+ " Y(J<T, ? extends U> p) {}\n" + > "}\n" + >- "interface K<T, U> extends I<T, U>, J<T, U> {\n" + >- "}" >+ "interface I<T, U> {}\n" + >+ "interface J<T, U> extends I<T, U> {}\n" + >+ "interface K<T, U> extends I<T, U>, J<T, U> {}" > }, > "" > ); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=189933 > // variant >-public void _test061() { >+public void test061() { > this.runNegativeTest( > new String[] { > "X.java", > "public class X<T> {\n" + >- " public void bar(K<T, Object> p) {\n" + >- " new Y(p);\n" + >- " new Y((J<T, Object>) p);\n" + >- " new Y((I<T, Object>) p);\n" + >- " }\n" + >+ " public void bar(K<T, Object> p) {\n" + >+ " new Y(p);\n" + >+ " new Y((J<T, Object>) p);\n" + >+ " new Y((I<T, Object>) p);\n" + >+ " }\n" + > "}\n" + > "class Y<T, U> {\n" + >- " Y(I<? extends T, ? extends U> p) {\n" + >- " }\n" + >- " Y(J<T, ? extends U> p) {\n" + >- " }\n" + >- "}\n" + >- "interface I<T, U> { \n" + >+ " Y(I<? extends T, ? extends U> p) {}\n" + >+ " Y(J<T, ? extends U> p) {}\n" + > "}\n" + >- "interface J<T, U> {\n" + >- "}\n" + >- "interface K<T, U> extends I<T, U>, J<T, U> {\n" + >- "}" >+ "interface I<T, U> {}\n" + >+ "interface J<T, U> {}\n" + >+ "interface K<T, U> extends I<T, U>, J<T, U> {}" > }, > "----------\n" + > "1. ERROR in X.java (at line 3)\n" +
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 189933
:
69682
|
70019
|
70140
| 70148