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 146982 Details for
Bug 289247
[1.5][compiler]Detecting duplicate methods should not consider return type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch for test changes
patch.txt (text/plain), 109.75 KB, created by
Kent Johnson
on 2009-09-11 14:29:58 EDT
(
hide
)
Description:
Proposed patch for test changes
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-09-11 14:29:58 EDT
Size:
109.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java,v >retrieving revision 1.65 >diff -u -r1.65 JavadocBugsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 19 Aug 2009 14:57:15 -0000 1.65 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 11 Sep 2009 18:32:31 -0000 >@@ -5994,7 +5994,7 @@ > * @test Ensure that no warning are raised when ambiguous parameterized methods are present in javadoc comments > * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165794" > */ >-public void testBug165794() { >+public void _testBug165794() { > String[] testFiles = new String[] { > "X.java", > "/**\n" + >Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v >retrieving revision 1.187 >diff -u -r1.187 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 17 Aug 2009 15:51:04 -0000 1.187 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 11 Sep 2009 18:32:31 -0000 >@@ -3223,8 +3223,7 @@ > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X1.java", > "import java.util.*;\n" + >@@ -3232,13 +3231,31 @@ > " public Object putAll(Map<String,String> a) { return null; }\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. WARNING in X1.java (at line 2)\n" + >+ " public class X1 extends LinkedHashMap<String, String> {\n" + >+ " ^^\n" + >+ "The serializable class X1 does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "2. ERROR in X1.java (at line 3)\n" + >+ " public Object putAll(Map<String,String> a) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method putAll(Map<String,String>) of type X1 has the same erasure as putAll(Map<? extends K,? extends V>) of type HashMap<K,V> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:4: name clash: putAll(Map<String,String>) in X1 and putAll(Map<? extends K,? extends V>) in HashMap have the same erasure, yet neither overrides the other >+ public Object putAll(Map<String,String> a) { return null; } >+ ^ >+ where K,V are type-variables: >+ K extends Object declared in class HashMap >+ V extends Object declared in class HashMap >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048a() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X2.java", > "public class X2 extends Y<String> {\n" + >@@ -3251,8 +3268,21 @@ > " public void foo(I<? extends T> a);\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X2.java (at line 2)\n" + >+ " public Object foo(I<String> z) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(I<String>) of type X2 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X2 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public Object foo(I<String> z) { return null; } >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048b() { >@@ -3275,13 +3305,19 @@ > " ^^^^^^^^^^^^^^^^\n" + > "Name clash: The method foo(I<String>) of type X3 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + > "----------\n" >- // name clash: foo(I<java.lang.String>) in X and foo(I<? extends T>) in Y<java.lang.String> have the same erasure, yet neither overrides the other > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X3 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public void foo(I<String> z) {} >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048c() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X4.java", > "public class X4 extends Y<String> {\n" + >@@ -3294,13 +3330,25 @@ > " public Object foo(I<? extends T> a);\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X4.java (at line 2)\n" + >+ " public String foo(I<String> z) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(I<String>) of type X4 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X4 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public String foo(I<String> z) { return null; } >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048d() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X5.java", > "public class X5 extends Y<String> {\n" + >@@ -3313,13 +3361,26 @@ > " public String foo(I<? extends T> a);\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X5.java (at line 2)\n" + >+ " public Object foo(I<String> z) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(I<String>) of type X5 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X5 and foo(I<? extends T>) in Y have the >+ same erasure, yet neither overrides the other >+ public Object foo(I<String> z) { return null; } >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048e() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X6.java", > "public class X6 extends Y<String> {\n" + >@@ -3332,13 +3393,25 @@ > " public Object foo(I<? extends T> a);\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X6.java (at line 2)\n" + >+ " public void foo(I<String> z) {}\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(I<String>) of type X6 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X6 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public void foo(I<String> z) {} >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048f() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X7.java", > "public class X7 extends Y<String> {\n" + >@@ -3351,8 +3424,21 @@ > " public T foo(I<? extends T> a);\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X7.java (at line 2)\n" + >+ " public String foo(I<String> z) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(I<String>) of type X7 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X7 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public String foo(I<String> z) { return null; } >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 > public void test048g() { >@@ -3375,8 +3461,15 @@ > " ^^^^^^^^^^^^^^^^\n" + > "Name clash: The method foo(I<String>) of type X8 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" + > "----------\n" >- // name clash: foo(I<java.lang.String>) in X7 and foo(I<? extends T>) in Y<java.lang.String> have the same erasure, yet neither overrides the other > ); >+/* javac 7 >+X.java:2: name clash: foo(I<String>) in X8 and foo(I<? extends T>) in Y have the same erasure, yet neither overrides the other >+ public Object foo(I<String> z) { return null; } >+ ^ >+ where T is a type-variable: >+ T extends Object declared in class Y >+1 error >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88094 >@@ -3439,60 +3532,104 @@ > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 > public void test050() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >- " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" + >- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >- " public static void main(String[] args) {\n" + >- " X.<A>foo();\n" + >- " X.<B>foo();\n" + >- " new X().<B>foo();\n" + >- " }\n" + >+ " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" + >+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >+ " public static void main(String[] args) {\n" + >+ " X.<A>foo();\n" + >+ " X.<B>foo();\n" + >+ " new X().<B>foo();\n" + >+ " }\n" + > "}\n" + > "class A {}\n" + >- "class B {}\n" >+ "class B {}" > }, >- "ABB" >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " X.<B>foo();\n" + >+ " ^^^\n" + >+ "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " new X().<B>foo();\n" + >+ " ^^^\n" + >+ "Bound mismatch: The generic method foo() of type X is not applicable for the arguments (). The inferred type B is not a valid substitute for the bounded parameter <S extends A>\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: name clash: <N>foo() and <S>foo() have the same erasure >+ public static <N extends B> N foo() { System.out.print("B"); return null; } >+ ^ >+ where N,S are type-variables: >+ N extends B declared in method <N>foo() >+ S extends A declared in method <S>foo() >+X.java:6: method foo in class X cannot be applied to given types >+ X.<B>foo(); >+ ^ >+ required: no arguments >+ found: no arguments >+X.java:7: method foo in class X cannot be applied to given types >+ new X().<B>foo(); >+ ^ >+ required: no arguments >+ found: no arguments >+3 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 > public void test050a() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >- " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" + >- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >- " static void test () {\n" + >- " X.foo();\n" + >- " foo();\n" + >- " }\n" + >+ " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" + >+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >+ " static void test () {\n" + >+ " X.foo();\n" + >+ " foo();\n" + >+ " }\n" + > "}\n" + > "class A {}\n" + >- "class B {}\n" >+ "class B {}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 5)\r\n" + >- " X.foo();\r\n" + >- " ^^^\n" + >- "The method foo() is ambiguous for the type X\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 6)\r\n" + >- " foo();\r\n" + >- " ^^^\n" + >- "The method foo() is ambiguous for the type X\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + > "----------\n" >- // both references are ambiguous > ); >+/* javac 7 >+X.java:3: name clash: <N>foo() and <S>foo() have the same erasure >+ public static <N extends B> N foo() { System.out.print("B"); return null; } >+ ^ >+ where N,S are type-variables: >+ N extends B declared in method <N>foo() >+ S extends A declared in method <S>foo() >+1 error >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation > public void test050b() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", >@@ -3502,8 +3639,8 @@ > " Z foo(Object o) { return null; } // duplicate\n" + > " }\n" + > " class C2 {\n" + >- " <T extends Y> T foo(Object o) { return null; } // ok\n" + >- " <T extends Z> T foo(Object o) { return null; } // ok\n" + >+ " <T extends Y> T foo(Object o) { return null; } // duplicate\n" + >+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" + > " }\n" + > " class C3 {\n" + > " A<Y> foo(Object o) { return null; } // duplicate\n" + >@@ -3514,49 +3651,73 @@ > " <T extends Z> T foo(Object o) { return null; } // duplicate\n" + > " }\n" + > "}\n" + >- "class A<T> {}" + >- "class Y {}" + >+ "class A<T> {}\n" + >+ "class Y {}\n" + > "class Z {}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " Y foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C1\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >- " Z foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C1\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 11)\n" + >- " A<Y> foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C3\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 12)\n" + >- " A<Z> foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C3\n" + >- "----------\n" + >- "5. ERROR in X.java (at line 15)\n" + >- " Y foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C4\n" + >- "----------\n" + >- "6. ERROR in X.java (at line 16)\n" + >- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^^^\n" + >- "Duplicate method foo(Object) in type X.C4\n" + >- "----------\n" >- // foo(java.lang.Object) is already defined in X.C1 >- // foo(java.lang.Object) is already defined in X.C3 >- // foo(java.lang.Object) is already defined in X.C4 >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Y foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C1\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " Z foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C1\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 7)\n" + >+ " <T extends Y> T foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C2\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C2\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 11)\n" + >+ " A<Y> foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C3\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 12)\n" + >+ " A<Z> foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C3\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 15)\n" + >+ " Y foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C4\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 16)\n" + >+ " <T extends Z> T foo(Object o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C4\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:4: foo(Object) is already defined in X.C1 >+ Z foo(Object o) { return null; } // duplicate >+ ^ >+X.java:8: name clash: <T#1>foo(Object) and <T#2>foo(Object) have the same erasure >+ <T extends Z> T foo(Object o) { return null; } // duplicate >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends Z declared in method <T#1>foo(Object) >+ T#2 extends Y declared in method <T#2>foo(Object) >+X.java:12: foo(Object) is already defined in X.C3 >+ A<Z> foo(Object o) { return null; } // duplicate >+ ^ >+X.java:16: foo(Object) is already defined in X.C4 >+ <T extends Z> T foo(Object o) { return null; } // duplicate >+ ^ >+4 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation > public void test050c() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", >@@ -3570,28 +3731,48 @@ > " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" + > " }\n" + > "}\n" + >- "class A<T> {}" + >- "class Y {}" + >+ "class A<T> {}\n" + >+ "class Y {}\n" + > "class Z {}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " A<Y> foo(A<Y> o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^\n" + >- "Method foo(A<Y>) has the same erasure foo(A<T>) as another method in type X.C5\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >- " A<Z> foo(A<Z> o) { return null; } // duplicate\n" + >- " ^^^^^^^^^^^\n" + >- "Method foo(A<Z>) has the same erasure foo(A<T>) as another method in type X.C5\n" + >- "----------\n" >- // name clash: foo(A<Y>) and foo(A<Z>) have the same erasure >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " A<Y> foo(A<Y> o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^\n" + >+ "Method foo(A<Y>) has the same erasure foo(A<T>) as another method in type X.C5\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " A<Z> foo(A<Z> o) { return null; } // duplicate\n" + >+ " ^^^^^^^^^^^\n" + >+ "Method foo(A<Z>) has the same erasure foo(A<T>) as another method in type X.C5\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 7)\n" + >+ " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^\n" + >+ "Method foo(A<Y>) has the same erasure foo(A<T>) as another method in type X.C6\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^\n" + >+ "Method foo(A<Z>) has the same erasure foo(A<T>) as another method in type X.C6\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:4: name clash: foo(A<Z>) and foo(A<Y>) have the same erasure >+ A<Z> foo(A<Z> o) { return null; } // duplicate >+ ^ >+X.java:8: name clash: <T#1>foo(A<Z>) and <T#2>foo(A<Y>) have the same erasure >+ <T extends Z> T foo(A<Z> o) { return null; } // ok >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends Z declared in method <T#1>foo(A<Z>) >+ T#2 extends Y declared in method <T#2>foo(A<Y>) >+2 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation > public void test050d() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -3600,18 +3781,37 @@ > " <T extends Z> T foo(Object o) { return null; } // ok\n" + > " }\n" + > "}\n" + >- "class A<T> {}" + >- "class Y {}" + >+ "class A<T> {}\n" + >+ "class Y {}\n" + > "class Z {}" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " <T extends Y, U> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C7\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " <T extends Z> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C7\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:4: name clash: <T#1>foo(Object) and <T#2,U>foo(Object) have the same erasure >+ <T extends Z> T foo(Object o) { return null; } // ok >+ ^ >+ where T#1,T#2,U are type-variables: >+ T#1 extends Z declared in method <T#1>foo(Object) >+ T#2 extends Y declared in method <T#2,U>foo(Object) >+ U extends Object declared in method <T#2,U>foo(Object) >+1 error >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050e() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -3625,8 +3825,56 @@ > "class A<T> {}\n" + > "class B {}\n" > }, >- "" >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " <N extends B> N a(A<String> s) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method a(A<String>) has the same erasure a(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <N> Object a(A<Number> n) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method a(A<Number>) has the same erasure a(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " <N extends B> void b(A<String> s) {}\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method b(A<String>) has the same erasure b(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " <N extends B> B b(A<Number> n) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method b(A<Number>) has the same erasure b(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 6)\n" + >+ " void c(A<String> s) {}\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method c(A<String>) has the same erasure c(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 7)\n" + >+ " B c(A<Number> n) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method c(A<Number>) has the same erasure c(A<T>) as another method in type X\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: name clash: <N#1>a(A<Number>) and <N#2>a(A<String>) have the same erasure >+ <N> Object a(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>a(A<Number>) >+ N#2 extends B declared in method <N#2>a(A<String>) >+X.java:5: name clash: <N#1>b(A<Number>) and <N#2>b(A<String>) have the same erasure >+ <N extends B> B b(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends B declared in method <N#1>b(A<Number>) >+ N#2 extends B declared in method <N#2>b(A<String>) >+X.java:7: name clash: c(A<Number>) and c(A<String>) have the same erasure >+ B c(A<Number> n) { return null; } >+ ^ >+3 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050f() { >@@ -3651,8 +3899,16 @@ > " ^^^^^^^^^^^^^^\n" + > "Method a(A<Number>) has the same erasure a(A<T>) as another method in type X\n" + > "----------\n" >- // name clash: <N>a(A<java.lang.String>) and <N>a(A<java.lang.Number>) have the same erasure > ); >+/* javac 7 >+X.java:3: name clash: <N#1>a(A<Number>) and <N#2>a(A<String>) have the same erasure >+ <N> B a(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>a(A<Number>) >+ N#2 extends B declared in method <N#2>a(A<String>) >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050g() { >@@ -3677,8 +3933,16 @@ > " ^^^^^^^^^^^^^^\n" + > "Method b(A<Number>) has the same erasure b(A<T>) as another method in type X\n" + > "----------\n" >- // name clash: <N>b(A<java.lang.String>) and <N>b(A<java.lang.Number>) have the same erasure > ); >+/* javac 7 >+X.java:3: name clash: <N#1>b(A<Number>) and <N#2>b(A<String>) have the same erasure >+ <N extends B> B b(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends B declared in method <N#1>b(A<Number>) >+ N#2 extends B declared in method <N#2>b(A<String>) >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050h() { >@@ -3703,14 +3967,18 @@ > " ^^^^^^^^^^^^^^\n" + > "Method c(A<Number>) has the same erasure c(A<T>) as another method in type X\n" + > "----------\n" >- // name clash: c(A<java.lang.String>) and c(A<java.lang.Number>) have the same erasure > ); >+/* javac 7 >+X.java:3: name clash: c(A<Number>) and c(A<String>) have the same erasure >+ B c(A<Number> n) { return null; } >+ ^ >+1 error >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050i() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -3722,8 +3990,43 @@ > "class A<T> {}\n" + > "class B {}\n" > }, >- "" >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " <N extends B> N a(A<Number> s) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Duplicate method a(A<Number>) in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <N> Object a(A<Number> n) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Duplicate method a(A<Number>) in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " <N extends B> N b(A<Number> s) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method b(A<Number>) has the same erasure b(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " <N> Object b(A<String> n) { return null; }\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method b(A<String>) has the same erasure b(A<T>) as another method in type X\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: name clash: <N#1>a(A<Number>) and <N#2>a(A<Number>) have the same erasure >+ <N> Object a(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>a(A<Number>) >+ N#2 extends B declared in method <N#2>a(A<Number>) >+X.java:5: name clash: <N#1>b(A<String>) and <N#2>b(A<Number>) have the same erasure >+ <N> Object b(A<String> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>b(A<String>) >+ N#2 extends B declared in method <N#2>b(A<Number>) >+2 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050j() { >@@ -3760,9 +4063,22 @@ > " ^^^^^^^^^^^^^^\n" + > "Method b(A<String>) has the same erasure b(A<T>) as another method in type X\n" + > "----------\n" >- // name clash: <N>a(A<java.lang.Number>) and <N>a(A<java.lang.Number>) have the same erasure >- // name clash: <N>b(A<java.lang.Number>) and <N>b(A<java.lang.String>) have the same erasure > ); >+/* javac 7 >+X.java:3: name clash: <N#1>a(A<Number>) and <N#2>a(A<Number>) have the same erasure >+ <N> B a(A<Number> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>a(A<Number>) >+ N#2 extends B declared in method <N#2>a(A<Number>) >+X.java:5: name clash: <N#1>b(A<String>) and <N#2>b(A<Number>) have the same erasure >+ <N> B b(A<String> n) { return null; } >+ ^ >+ where N#1,N#2 are type-variables: >+ N#1 extends Object declared in method <N#1>b(A<String>) >+ N#2 extends B declared in method <N#2>b(A<Number>) >+2 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050k() { >@@ -3799,9 +4115,20 @@ > " ^^^^^^^^^^^^^^\n" + > "Duplicate method b(A<Number>) in type X\n" + > "----------\n" >- // <N>a(A<java.lang.Number>) is already defined in X >- // <N>b(A<java.lang.Number>) is already defined in X > ); >+/* javac 7 >+X.java:3: <N>a(A<Number>) is already defined in X >+ <N extends B> B a(A<Number> n) { return null; } >+ ^ >+ where N is a type-variable: >+ N extends B declared in method <N>a(A<Number>) >+X.java:5: <N>b(A<Number>) is already defined in X >+ <N extends B> B b(A<Number> n) { return null; } >+ ^ >+ where N is a type-variable: >+ N extends B declared in method <N>b(A<Number>) >+2 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 > public void test050l() { >@@ -3838,9 +4165,16 @@ > " ^^^^^^^^^^^^^^\n" + > "Duplicate method b(A<Number>) in type X\n" + > "----------\n" >- // a(A<java.lang.Number>) is already defined in X >- // b(A<java.lang.Number>) is already defined in X > ); >+/* javac 7 >+X.java:3: a(A<Number>) is already defined in X >+ B a(A<Number> n) { return null; } >+ ^ >+X.java:5: b(A<Number>) is already defined in X >+ B b(A<Number> n) { return null; } >+ ^ >+2 errors >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470 >@@ -3861,8 +4195,15 @@ > " ^\n" + > "The type X must implement the inherited abstract method I.foo(T)\n" + > "----------\n" >- // X is not abstract and does not override abstract method <T>foo(T) in I > ); >+/* javac 7 >+X.java:1: X is not abstract and does not override abstract method <T>foo(T) in I >+class X implements I { >+^ >+ where T is a type-variable: >+ T extends Object declared in method <T>foo(T) >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470 > public void test051a() { >@@ -3886,13 +4227,17 @@ > " ^^^^^^^^^^^^^^^^^\n" + > "Method foo(A<Integer>) has the same erasure foo(A<T>) as another method in type X\n" + > "----------\n" >- // name clash: foo(A<java.lang.String>) and foo(A<java.lang.Integer>) have the same erasure > ); >+/* javac 7 >+X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure >+ void foo(A<Integer> a) {} >+ ^ >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470 > public void test051b() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -3901,8 +4246,24 @@ > "}\n" + > "class A<T> {}\n", > }, >- "" >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(A<String> a) {}\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<String>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Object foo(A<Integer> a) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<Integer>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure >+ Object foo(A<Integer> a) { return null; } >+ ^ >+1 error >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91728 >@@ -4037,12 +4398,16 @@ > " ^^^^^^\n" + > "Method a(T) has the same erasure a(Object) as another method in type X\n" + > "----------\n" >- // a(X) is already defined in X > ); >+/* javac 7 >+X.java:3: a(Object) is already defined in X >+ <T> T a(T x) { return null; } >+ ^ >+1 error >+ */ > } > // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 > public void test054a() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", >@@ -4053,29 +4418,82 @@ > " <T extends X> T aa(T x) { return null; }\n" + > " String a(X x) { return null; }\n" + // dup > " <T extends X> T a(T x) { return null; }\n" + >- > " <T> String z(X x) { return null; }\n" + > " <T, S> Object z(X x) { return null; }\n" + > "}\n" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 6)\n" + >- " String a(X x) { return null; }\n" + >- " ^^^^^^\n" + >- "Method a(X) has the same erasure a(X) as another method in type X\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 7)\n" + >- " <T extends X> T a(T x) { return null; }\n" + >- " ^^^^^^\n" + >- "Method a(T) has the same erasure a(X) as another method in type X\n" + >- "----------\n" >- // a(X) is already defined in X >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " <T1, T2> String aaa(X x) { return null; }\n" + >+ " ^^^^^^^^\n" + >+ "Method aaa(X) has the same erasure aaa(X) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <T extends X> T aaa(T x) { return null; }\n" + >+ " ^^^^^^^^\n" + >+ "Method aaa(T) has the same erasure aaa(X) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " <T> String aa(X x) { return null; }\n" + >+ " ^^^^^^^\n" + >+ "Method aa(X) has the same erasure aa(X) as another method in type X\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " <T extends X> T aa(T x) { return null; }\n" + >+ " ^^^^^^^\n" + >+ "Method aa(T) has the same erasure aa(X) as another method in type X\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 6)\n" + >+ " String a(X x) { return null; }\n" + >+ " ^^^^^^\n" + >+ "Method a(X) has the same erasure a(X) as another method in type X\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 7)\n" + >+ " <T extends X> T a(T x) { return null; }\n" + >+ " ^^^^^^\n" + >+ "Method a(T) has the same erasure a(X) as another method in type X\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 8)\n" + >+ " <T> String z(X x) { return null; }\n" + >+ " ^^^^^^\n" + >+ "Duplicate method z(X) in type X\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 9)\n" + >+ " <T, S> Object z(X x) { return null; }\n" + >+ " ^^^^^^\n" + >+ "Duplicate method z(X) in type X\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: name clash: <T>aaa(T) and <T1,T2>aaa(X) have the same erasure >+ <T extends X> T aaa(T x) { return null; } >+ ^ >+ where T,T1,T2 are type-variables: >+ T extends X declared in method <T>aaa(T) >+ T1 extends Object declared in method <T1,T2>aaa(X) >+ T2 extends Object declared in method <T1,T2>aaa(X) >+X.java:5: name clash: <T#1>aa(T#1) and <T#2>aa(X) have the same erasure >+ <T extends X> T aa(T x) { return null; } >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends X declared in method <T#1>aa(T#1) >+ T#2 extends Object declared in method <T#2>aa(X) >+X.java:7: a(X) is already defined in X >+ <T extends X> T a(T x) { return null; } >+ ^ >+X.java:9: name clash: <T#1,S>z(X) and <T#3>z(X) have the same erasure >+ <T, S> Object z(X x) { return null; } >+ ^ >+ where T#1,S,T#3 are type-variables: >+ T#1 extends Object declared in method <T#1,S>z(X) >+ S extends Object declared in method <T#1,S>z(X) >+ T#3 extends Object declared in method <T#3>z(X) >+4 errors >+ */ > } > // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 > public void test054b() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X<T> {\n" + >@@ -4083,8 +4501,27 @@ > " <S> String foo(X<T> s) { return null; }\n" + > "}\n" > }, >- "" >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " Object foo(X<T> t) { return null; }\n" + >+ " ^^^^^^^^^^^\n" + >+ "Duplicate method foo(X<T>) in type X<T>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <S> String foo(X<T> s) { return null; }\n" + >+ " ^^^^^^^^^^^\n" + >+ "Duplicate method foo(X<T>) in type X<T>\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:3: name clash: <S>foo(X<T>) and foo(X<T>) have the same erasure >+ <S> String foo(X<T> s) { return null; } >+ ^ >+ where S,T are type-variables: >+ S extends Object declared in method <S>foo(X<T>) >+ T extends Object declared in class X >+1 error >+ */ > } > // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 > public void test054c() { >@@ -4107,13 +4544,19 @@ > " ^^^^^^\n" + > "Duplicate method dupT() in type X<T>\n" + > "----------\n" >- // <T1>dupT() is already defined in X > ); >+/* javac 7 >+X.java:3: <T1>dupT() is already defined in X >+ <T2 extends X<T2>> Object dupT() {return null;} >+ ^ >+ where T1 is a type-variable: >+ T1 extends X<T1> declared in method <T1>dupT() >+1 error >+ */ > } > // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 > public void test054d() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -4124,8 +4567,43 @@ > "}\n" + > "class A<T> {}\n", > }, >- "" >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " <T> T a(A<T> t) {return null;}\n" + >+ " ^^^^^^^^^\n" + >+ "Method a(A<T>) has the same erasure a(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <T> String a(A<Object> o) {return null;}\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Method a(A<Object>) has the same erasure a(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " <T> T aa(A<T> t) {return null;}\n" + >+ " ^^^^^^^^^^\n" + >+ "Method aa(A<T>) has the same erasure aa(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " String aa(A<Object> o) {return null;}\n" + >+ " ^^^^^^^^^^^^^^^\n" + >+ "Method aa(A<Object>) has the same erasure aa(A<T>) as another method in type X\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: name clash: <T#1>a(A<Object>) and <T#2>a(A<T#2>) have the same erasure >+ >+ <T> String a(A<Object> o) {return null;} >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends Object declared in method <T#1>a(A<Object>) >+ T#2 extends Object declared in method <T#2>a(A<T#2>) >+X.java:5: name clash: aa(A<Object>) and <T>aa(A<T>) have the same erasure >+ String aa(A<Object> o) {return null;} >+ ^ >+ where T is a type-variable: >+ T extends Object declared in method <T>aa(A<T>) >+2 errors >+ */ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95933 >@@ -4233,46 +4711,69 @@ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 > public void test058a() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", > "public class X<A> {\n" + >- " void test() {\n" + >- " new X<Object>().foo(\"X\");\n" + >- " new X<Object>().foo2(\"X\");\n" + >- " }\n" + >+ " void test() {\n" + >+ " new X<Object>().foo(\"X\");\n" + >+ " new X<Object>().foo2(\"X\");\n" + >+ " }\n" + > " <T> T foo(T t) {return null;}\n" + > " void foo(A a) {}\n" + > " <T> T foo2(T t) {return null;}\n" + > " <T> void foo2(A a) {}\n" + > "}\n" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 3)\r\n" + >- " new X<Object>().foo(\"X\");\r\n" + >- " ^^^\n" + >- "The method foo(String) is ambiguous for the type X<Object>\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\r\n" + >- " new X<Object>().foo2(\"X\");\r\n" + >- " ^^^^\n" + >- "The method foo2(String) is ambiguous for the type X<Object>\n" + >- "----------\n" >- // both references are ambiguous >- ); >+ "----------\n" + >+ "1. ERROR in X.java (at line 6)\n" + >+ " <T> T foo(T t) {return null;}\n" + >+ " ^^^^^^^^\n" + >+ "Method foo(T) has the same erasure foo(Object) as another method in type X<A>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 7)\n" + >+ " void foo(A a) {}\n" + >+ " ^^^^^^^^\n" + >+ "Method foo(A) has the same erasure foo(Object) as another method in type X<A>\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 8)\n" + >+ " <T> T foo2(T t) {return null;}\n" + >+ " ^^^^^^^^^\n" + >+ "Method foo2(T) has the same erasure foo2(Object) as another method in type X<A>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 9)\n" + >+ " <T> void foo2(A a) {}\n" + >+ " ^^^^^^^^^\n" + >+ "Method foo2(A) has the same erasure foo2(Object) as another method in type X<A>\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:7: name clash: foo(A) and <T>foo(T) have the same erasure >+ void foo(A a) {} >+ ^ >+ where A,T are type-variables: >+ A extends Object declared in class X >+ T extends Object declared in method <T>foo(T) >+X.java:9: name clash: <T#1>foo2(A) and <T#3>foo2(T#3) have the same erasure >+ <T> void foo2(A a) {} >+ ^ >+ where T#1,A,T#3 are type-variables: >+ T#1 extends Object declared in method <T#1>foo2(A) >+ A extends Object declared in class X >+ T#3 extends Object declared in method <T#3>foo2(T#3) >+2 errors >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 > public void test058b() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", > "public class X<A> extends Y<A> {\n" + >- " void test() {\n" + >- " new X<Object>().foo(\"X\");\n" + >- " new X<Object>().foo2(\"X\");\n" + >- " }\n" + >+ " void test() {\n" + >+ " new X<Object>().foo(\"X\");\n" + >+ " new X<Object>().foo2(\"X\");\n" + >+ " }\n" + > " <T> T foo(T t) {return null;}\n" + > " <T> T foo2(T t) {return null;}\n" + > "}\n" + >@@ -4282,18 +4783,56 @@ > "}" > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\r\n" + >- " new X<Object>().foo(\"X\");\r\n" + >- " ^^^\n" + >- "The method foo(String) is ambiguous for the type X<Object>\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\r\n" + >- " new X<Object>().foo2(\"X\");\r\n" + >- " ^^^^\n" + >- "The method foo2(String) is ambiguous for the type X<Object>\n" + >- "----------\n" >- // both references are ambiguous >- ); >+ "1. ERROR in X.java (at line 3)\n" + >+ " new X<Object>().foo(\"X\");\n" + >+ " ^^^\n" + >+ "The method foo(String) is ambiguous for the type X<Object>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " new X<Object>().foo2(\"X\");\n" + >+ " ^^^^\n" + >+ "The method foo2(String) is ambiguous for the type X<Object>\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " <T> T foo(T t) {return null;}\n" + >+ " ^^^^^^^^\n" + >+ "Name clash: The method foo(T) of type X<A> has the same erasure as foo(A) of type Y<A> but does not override it\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " <T> T foo2(T t) {return null;}\n" + >+ " ^^^^^^^^^\n" + >+ "Name clash: The method foo2(T) of type X<A> has the same erasure as foo2(A) of type Y<A> but does not override it\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:3: reference to foo is ambiguous, both method foo(A) in Y and method <T>foo(T) in X match >+ new X<Object>().foo("X"); >+ ^ >+ where A,T are type-variables: >+ A extends Object declared in class Y >+ T extends Object declared in method <T>foo(T) >+X.java:4: reference to foo2 is ambiguous, both method <T#1>foo2(A) in Y and method <T#3>foo2(T#3) in X match >+ new X<Object>().foo2("X"); >+ ^ >+ where T#1,A,T#3 are type-variables: >+ T#1 extends Object declared in method <T#1>foo2(A) >+ A extends Object declared in class Y >+ T#3 extends Object declared in method <T#3>foo2(T#3) >+X.java:6: name clash: <T>foo(T) in X and foo(A) in Y have the same erasure, yet neither overrides the other >+ <T> T foo(T t) {return null;} >+ ^ >+ where T,A are type-variables: >+ T extends Object declared in method <T>foo(T) >+ A extends Object declared in class Y >+X.java:7: name clash: <T#1>foo2(T#1) in X and <T#2>foo2(A) in Y have the same erasure, yet neither overrides the other >+ <T> T foo2(T t) {return null;} >+ ^ >+ where T#1,T#2,A are type-variables: >+ T#1 extends Object declared in method <T#1>foo2(T#1) >+ T#2 extends Object declared in method <T#2>foo2(A) >+ A extends Object declared in class Y >+4 errors >+ */ > } > > public void test059() { >@@ -6228,7 +6767,6 @@ > > // name conflict > public void test101() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() > this.runNegativeTest( > new String[] { > "X.java", >@@ -6250,16 +6788,26 @@ > " }\n" + > "}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 11)\n" + >- " Integer getX(List<Integer> l) {\n" + >- " ^^^^^^^^^^^^^^^^^^^^^\n" + >- "Duplicate method getX(List<Integer>) in type Y\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 14)\n" + >- " String getX(List<Integer> l) {\n" + >- " ^^^^^^^^^^^^^^^^^^^^^\n" + >- "Duplicate method getX(List<Integer>) in type Y\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Integer getX(List<Integer> l) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method getX(List<Integer>) has the same erasure getX(List<E>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " String getX(List<String> l) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method getX(List<String>) has the same erasure getX(List<E>) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 11)\n" + >+ " Integer getX(List<Integer> l) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Duplicate method getX(List<Integer>) in type Y\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 14)\n" + >+ " String getX(List<Integer> l) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Duplicate method getX(List<Integer>) in type Y\n" + > "----------\n" > ); > } >@@ -7313,8 +7861,7 @@ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202830 > public void test120a() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "Bar.java", > "class Foo<V, E> {\n" + >@@ -7323,7 +7870,17 @@ > "}\n" + > "public class Bar<V,E> extends Foo<V,E> {}" > }, >- "" >+ "----------\n" + >+ "1. ERROR in Bar.java (at line 2)\n" + >+ " int getThing(V v) { return 1; }\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Method getThing(V) has the same erasure getThing(Object) as another method in type Foo<V,E>\n" + >+ "----------\n" + >+ "2. ERROR in Bar.java (at line 3)\n" + >+ " boolean getThing(E e) { return true; }\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Method getThing(E) has the same erasure getThing(Object) as another method in type Foo<V,E>\n" + >+ "----------\n" > ); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=173477 >@@ -9013,7 +9570,7 @@ > > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=251091 > public void test177() { >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) { // see test187() >+ if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_6) { // see test187() > this.runNegativeTest( > new String[] { > "X.java", >@@ -9058,21 +9615,6 @@ > "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" + > "----------\n" > ); >- } else if (new CompilerOptions(getCompilerOptions()).sourceLevel == ClassFileConstants.JDK1_6) { >- this.runConformTest( >- new String[] { >- "X.java", >- "import java.util.*;\n" + >- "interface I { I foo(Collection<?> c); }\n" + >- "class A extends LinkedHashMap {\n" + >- " public A foo(Collection c) { return this; }\n" + >- "}\n" + >- "class X extends A implements I {\n" + >- " @Override public X foo(Collection<?> c) { return this; }\n" + >- "}" >- }, >- "" >- ); > } else { > this.runNegativeTest( > new String[] { >@@ -9086,31 +9628,41 @@ > " @Override public X foo(Collection<?> c) { return this; }\n" + > "}" > }, >- "----------\n" + >- "1. WARNING in X.java (at line 3)\n" + >- " class A extends LinkedHashMap {\n" + >- " ^\n" + >- "The serializable class A does not declare a static final serialVersionUID field of type long\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 3)\n" + >- " class A extends LinkedHashMap {\n" + >- " ^^^^^^^^^^^^^\n" + >- "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 4)\n" + >- " public A foo(Collection c) { return this; }\n" + >- " ^^^^^^^^^^\n" + >- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 6)\n" + >- " class X extends A implements I {\n" + >- " ^\n" + >- "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >- "----------\n" + >- "5. ERROR in X.java (at line 7)\n" + >- " @Override public X foo(Collection<?> c) { return this; }\n" + >- " ^^^^^^^^^^^^^^^^^^^^\n" + >- "The method foo(Collection<?>) of type X must override a superclass method\n" + >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " class A extends LinkedHashMap {\n" + >+ " ^\n" + >+ "The serializable class A does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 3)\n" + >+ " class A extends LinkedHashMap {\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 4)\n" + >+ " public A foo(Collection c) { return this; }\n" + >+ " ^^^^^^^^^^\n" + >+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " class X extends A implements I {\n" + >+ " ^\n" + >+ "Name clash: The method foo(Collection<?>) of type I has the same erasure as foo(Collection) of type A but does not override it\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 6)\n" + >+ " class X extends A implements I {\n" + >+ " ^\n" + >+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 7)\n" + >+ " @Override public X foo(Collection<?> c) { return this; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 7)\n" + >+ " @Override public X foo(Collection<?> c) { return this; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "The method foo(Collection<?>) of type X must override a superclass method\n" + > "----------\n" > ); > } >@@ -9583,7 +10135,7 @@ > " int f(List<String> l) {return 0;}\n" + > "}\n" + > "class Y extends X {\n" + >- " double f(List<Integer> l) {return 0;}\n" + >+ " double f(List<Integer> l) {return 0;}\n" +// name clash in 7 > "}\n" + > "interface I {\n" + > " double f(List<Integer> l);\n" + >@@ -9591,32 +10143,30 @@ > "abstract class Z extends X implements I {}\n" + > "class XX {\n" + > " int f(List<String> l) {return 0;}\n" + >- "double f(List<Integer> l) {return 0;}\n" + >+ "double f(List<Integer> l) {return 0;}\n" +// name clash in 1.5 & 7 > "}" > }, >- new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_7 >- ? "" >- : "----------\n" + >- "1. ERROR in X.java (at line 6)\n" + >- " double f(List<Integer> l) {return 0;}\n" + >- " ^^^^^^^^^^^^^^^^^^\n" + >- "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 11)\n" + >- " abstract class Z extends X implements I {}\n" + >- " ^\n" + >- "Name clash: The method f(List<String>) of type X has the same erasure as f(List<Integer>) of type I but does not override it\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 13)\n" + >- " int f(List<String> l) {return 0;}\n" + >- " ^^^^^^^^^^^^^^^^^\n" + >- "Method f(List<String>) has the same erasure f(List<E>) as another method in type XX\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 14)\n" + >- " double f(List<Integer> l) {return 0;}\n" + >- " ^^^^^^^^^^^^^^^^^^\n" + >- "Method f(List<Integer>) has the same erasure f(List<E>) as another method in type XX\n" + >- "----------\n" >+ "----------\n" + >+ "1. ERROR in X.java (at line 6)\n" + >+ " double f(List<Integer> l) {return 0;}\n" + >+ " ^^^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 11)\n" + >+ " abstract class Z extends X implements I {}\n" + >+ " ^\n" + >+ "Name clash: The method f(List<String>) of type X has the same erasure as f(List<Integer>) of type I but does not override it\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 13)\n" + >+ " int f(List<String> l) {return 0;}\n" + >+ " ^^^^^^^^^^^^^^^^^\n" + >+ "Method f(List<String>) has the same erasure f(List<E>) as another method in type XX\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 14)\n" + >+ " double f(List<Integer> l) {return 0;}\n" + >+ " ^^^^^^^^^^^^^^^^^^\n" + >+ "Method f(List<Integer>) has the same erasure f(List<E>) as another method in type XX\n" + >+ "----------\n" > ); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=279836 >@@ -10036,4 +10586,39 @@ > JavacTestOptions.SKIP > ); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=285088 >+public void test200() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "import java.util.Collection;\n" + >+ "class X {\n" + >+ " int foo(Collection bar) { return 0; }\n" + >+ " double foo(Collection<String> bar) {return 0; }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " int foo(Collection bar) { return 0; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Method foo(Collection) has the same erasure foo(Collection<E>) as another method in type X\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 3)\n" + >+ " int foo(Collection bar) { return 0; }\n" + >+ " ^^^^^^^^^^\n" + >+ "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " double foo(Collection<String> bar) {return 0; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method foo(Collection<String>) has the same erasure foo(Collection<E>) as another method in type X\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:4: foo(Collection) is already defined in X >+ double foo(Collection<String> bar) {return 0; } >+ ^ >+1 error >+ */ >+} > } >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.799 >diff -u -r1.799 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 18 Aug 2009 02:37:27 -0000 1.799 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 11 Sep 2009 18:32:31 -0000 >@@ -17606,8 +17606,7 @@ > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=87956 > public void test0561() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -17617,9 +17616,35 @@ > "}\n" + > "class A<T> {}\n", > }, >- "" >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(A<String> a) {}\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<String>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Object foo(A<Integer> a) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<Integer>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " void test(A<Integer> a) { foo(a); }\n" + >+ " ^^^\n" + >+ "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" + >+ "----------\n" > ); >- this.runConformTest( >+/* javac 7 >+X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure >+ Object foo(A<Integer> a) { return null; } >+ ^ >+X.java:4: method foo in class X cannot be applied to given types >+ void test(A<Integer> a) { foo(a); } >+ ^ >+ required: A<String> >+ found: A<Integer> >+2 errors >+ */ >+ this.runNegativeTest( > new String[] { > "X.java", > "public class X {\n" + >@@ -17629,7 +17654,33 @@ > "}\n" + > "class A<T> {}\n", > }, >- "" >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " Number foo(A<String> a) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<String>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Integer foo(A<Integer> a) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^^\n" + >+ "Method foo(A<Integer>) has the same erasure foo(A<T>) as another method in type X\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " void test(A<Integer> a) { foo(a); }\n" + >+ " ^^^\n" + >+ "The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" + >+ "----------\n" >+/* javac 7 >+X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure >+ Integer foo(A<Integer> a) { return null; } >+ ^ >+X.java:4: method foo in class X cannot be applied to given types >+ void test(A<Integer> a) { foo(a); } >+ ^ >+ required: A<String> >+ found: A<Integer> >+2 errors >+ */ > ); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=87550 >@@ -17940,7 +17991,6 @@ > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation > public void test0574() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -17957,22 +18007,37 @@ > " }\n" + > "}\n" > }, >- "----------\n" + >- "1. WARNING in X.java (at line 6)\n" + >- " <T extends Integer> T foo(Object o) { return null; } // ok\n" + >- " ^^^^^^^\n" + >- "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 7)\n" + >- " <T extends String> T foo(Object o) { return null; } // ok\n" + >- " ^^^^^^\n" + >- "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 10)\n" + >- " new X().new C2().foo((List<String>) null);\n" + >- " ^^^\n" + >- "The method foo(Object) is ambiguous for the type X.C2\n" + >- "----------\n"); >+ "----------\n" + >+ "1. WARNING in X.java (at line 6)\n" + >+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^^\n" + >+ "The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " <T extends Integer> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C2\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 7)\n" + >+ " <T extends String> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^\n" + >+ "The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " <T extends String> T foo(Object o) { return null; } // ok\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Duplicate method foo(Object) in type X.C2\n" + >+ "----------\n" >+ ); >+/* >+X.java:6: name clash: <T#1>foo(Object) and <T#2>foo(Object) have the same erasure >+ <T extends String> T foo(Object o) { return null; } // ok >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends String declared in method <T#1>foo(Object) >+ T#2 extends Integer declared in method <T#2>foo(Object) >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with field ref > public void test0575() { >@@ -22338,54 +22403,56 @@ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219 > public void test0706() { >- if (this.complianceLevel < ClassFileConstants.JDK1_7) { >- this.runConformTest( >- new String[] { >- "X.java", >- "public class X {\n" + >- " void foo() {\n" + >- " BB bb = new BB();\n" + >- " bb.<Object>test();\n" + >- " ((AA<CC>) bb).test();\n" + >- " }\n" + >- "}\n" + >- "class AA<T> { AA<Object> test() {return null;} }\n" + >- "class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >- "class CC {}\n", >- }, >- ""); >- return; >- } > this.runNegativeTest( >- new String[] { >- "X.java", >- "public class X {\n" + >- " void foo() {\n" + >- " BB bb = new BB();\n" + >- " bb.<Object>test();\n" + >- " ((AA<CC>) bb).test();\n" + >- " }\n" + >- "}\n" + >- "class AA<T> { AA<Object> test() {return null;} }\n" + >- "class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >- "class CC {}\n", >- }, >- "----------\n" + >- "1. ERROR in X.java (at line 4)\r\n" + >- " bb.<Object>test();\r\n" + >- " ^^^^\n" + >- "The method test() is ambiguous for the type BB\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 9)\n" + >- " class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >- " ^^^^^^\n" + >- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" + >- "----------\n"); >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " void foo() {\n" + >+ " BB bb = new BB();\n" + >+ " bb.<Object>test();\n" + >+ " ((AA<CC>) bb).test();\n" + >+ " }\n" + >+ "}\n" + >+ "class AA<T> { AA<Object> test() {return null;} }\n" + >+ "class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >+ "class CC {}\n", >+ }, >+ (this.complianceLevel < ClassFileConstants.JDK1_7) >+ ? "----------\n" + >+ "1. ERROR in X.java (at line 9)\n" + >+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >+ " ^^^^^^\n" + >+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" + >+ "----------\n" >+ : "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " bb.<Object>test();\n" + >+ " ^^^^\n" + >+ "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 9)\n" + >+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >+ " ^^^^^^\n" + >+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" + >+ "----------\n" >+ ); >+/* >+X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match >+ bb.<Object>test(); >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other >+class BB extends AA<CC> { <U> BB test() {return null;} } >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+2 errors >+ */ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219 > public void test0706a() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -22400,30 +22467,50 @@ > "class BB extends AA<CC> { <U> BB test() {return null;} }\n" + > "class CC {}\n", > }, >- "----------\n" + >- "1. ERROR in X.java (at line 4)\n" + >- " AA<Object> res1 = bb.test();\n" + >- " ^^^^\n" + >- "The method test() is ambiguous for the type BB\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 5)\n" + >- " AA res3 = bb.test();\n" + >- " ^^\n" + >- "AA is a raw type. References to generic type AA<T> should be parameterized\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 5)\n" + >- " AA res3 = bb.test();\n" + >- " ^^^^\n" + >- "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " AA<Object> res1 = bb.test();\n" + >+ " ^^^^\n" + >+ "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 5)\n" + >+ " AA res3 = bb.test();\n" + >+ " ^^\n" + >+ "AA is a raw type. References to generic type AA<T> should be parameterized\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " AA res3 = bb.test();\n" + >+ " ^^^^\n" + >+ "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 9)\n" + >+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >+ " ^^^^^^\n" + >+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" + > "----------\n" >- // 4: reference to test is ambiguous, both method test() in AA<CC> and method <U>test() in BB match >- // 5: reference to test is ambiguous, both method test() in AA<CC> and method <U>test() in BB match > ); >+/* >+X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match >+ AA<Object> res1 = bb.test(); >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+X.java:5: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match >+ AA res3 = bb.test(); >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other >+class BB extends AA<CC> { <U> BB test() {return null;} } >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+3 errors >+ */ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219 > public void test0706b() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -22438,22 +22525,51 @@ > "class BB extends AA<CC> { <U> BB test() {return null;} }\n" + > "class CC {}\n", > }, >- "----------\n" + >- "1. ERROR in X.java (at line 4)\n" + >- " AA<CC> res = bb.test();\n" + >- " ^^^^\n" + >- "The method test() is ambiguous for the type BB\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 5)\n" + >- " BB res2 = bb.test();\n" + >- " ^^^^\n" + >- "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " AA<CC> res = bb.test();\n" + >+ " ^^^^\n" + >+ "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " BB res2 = bb.test();\n" + >+ " ^^^^\n" + >+ "The method test() is ambiguous for the type BB\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 9)\n" + >+ " class BB extends AA<CC> { <U> BB test() {return null;} }\n" + >+ " ^^^^^^\n" + >+ "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" + > "----------\n" >- // 4: reference to test is ambiguous, both method test() in AA<CC> and method <U>test() in BB match >- // 4: incompatible types on the assignment >- // 5: reference to test is ambiguous, both method test() in AA<CC> and method <U>test() in BB match >- // 5: incompatible types on the assignment > ); >+/* >+X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match >+ AA<CC> res = bb.test(); >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+X.java:4: incompatible types >+ AA<CC> res = bb.test(); >+ ^ >+ required: AA<CC> >+ found: AA<Object> >+X.java:5: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match >+ BB res2 = bb.test(); >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+X.java:5: incompatible types >+ BB res2 = bb.test(); >+ ^ >+ required: BB >+ found: AA<Object> >+X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other >+class BB extends AA<CC> { <U> BB test() {return null;} } >+ ^ >+ where U is a type-variable: >+ U extends Object declared in method <U>test() >+5 errors >+ */ > this.runNegativeTest( > new String[] { > "X.java", >@@ -22479,8 +22595,20 @@ > " ^^^^^^^^^\n" + > "Type mismatch: cannot convert from AA<Object> to BB\n" + > "----------\n" >- // incompatible types on both assignments > ); >+/* >+X.java:4: incompatible types >+ AA<CC> res = bb.test(); >+ ^ >+ required: AA<CC> >+ found: AA<Object> >+X.java:5: incompatible types >+ BB res2 = bb.test(); >+ ^ >+ required: BB >+ found: AA<Object> >+2 errors >+ */ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98079 > public void test0707() { >@@ -23610,28 +23738,24 @@ > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100007 > public void test0748() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >- "public class X {\n" + >- " static interface Factory<T> {\n" + >- " public <U extends T> U create(Class<U> cl);\n" + >- " }\n" + >- " \n" + >- " static class BytesFactory implements Factory<byte[]> {\n" + >- " public byte[] create(Class<byte[]> cl) {\n" + >- " return null;\n" + >- " }\n" + >- " }\n" + >+ "interface Factory<T> {\n" + >+ " <U extends T> U create(Class<U> cl);\n" + >+ "}\n" + >+ "abstract class X implements Factory<byte[]> {\n" + >+ " public byte[] create(Class<byte[]> cl) { return null; }\n" + > "}\n", > }, >- "----------\n" + >- "1. ERROR in X.java (at line 6)\r\n" + >- " static class BytesFactory implements Factory<byte[]> {\r\n" + >- " ^^^^^^^^^^^^\n" + >- "The type X.BytesFactory must implement the inherited abstract method X.Factory<byte[]>.create(Class<U>)\n" + >- "----------\n"); >+ "----------\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " public byte[] create(Class<byte[]> cl) { return null; }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" + >+ "----------\n" >+ ); >+// javac 7 reports the name clash when X subclasses another class or is a concrete type > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100149 > public void test0749() { >@@ -40021,7 +40145,6 @@ > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204534 > public void test1181() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -40029,55 +40152,117 @@ > " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + > " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + > " }\n" + >- "\n" + > " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + > " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + > " }\n" + >- "\n" + > " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" + > " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + > " }\n" + >- "\n" + >- " public static void main(String[] args) {\n" + >- " }\n" + >+ " public static void main(String[] args) {}\n" + > "}\n", // ================= > }, >- "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + >- " ^\n" + >- "Cannot specify any additional bound T when first bound is a type parameter\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 2)\n" + >- " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + >- " ^^^^^^^^^^^^^^^^^^^\n" + >- "Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 3)\n" + >- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >- "Type safety: Unchecked cast from Object to R\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 6)\n" + >- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + >- " ^^^^^^^^^^\n" + >- "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" + >- "----------\n" + >- "5. ERROR in X.java (at line 6)\n" + >- " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + >- " ^^^^^^^^^^^^^^^^^^^\n" + >- "Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + >- "----------\n" + >- "6. WARNING in X.java (at line 7)\n" + >- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >- "Type safety: Unchecked cast from Object to R\n" + >- "----------\n" + >- "7. WARNING in X.java (at line 11)\n" + >- " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >- "Type safety: Unchecked cast from Object to R\n" + >- "----------\n"); >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + >+ " ^\n" + >+ "Cannot specify any additional bound T when first bound is a type parameter\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 3)\n" + >+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: Unchecked cast from Object to R\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + >+ " ^^^^^^^^^^\n" + >+ "Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 5)\n" + >+ " public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 6)\n" + >+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: Unchecked cast from Object to R\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 8)\n" + >+ " public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + >+ "----------\n" + >+ "8. WARNING in X.java (at line 9)\n" + >+ " return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: Unchecked cast from Object to R\n" + >+ "----------\n" >+ ); >+/* >+X.java:2: a type variable may not be followed by other bounds >+ public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) { >+ ^ >+X.java:5: a type variable may not be followed by other bounds >+ public static <T extends Comparable<S>, S, R extends S & Comparable<S>> >+R max(T arg1, S arg2) { >+ ^ >+X.java:5: name clash: <T#1,S#2,R#3>max(T#1,S#2) and <S#4,T#5,R#6>max(T#5,S#4) have the same erasure >+ public static <T extends Comparable<S>, S, R extends S & Comparable<S>> >+R max(T arg1, S arg2) { >+ >+ ^ >+ where T#1,S#2,R#3,S#4,T#5,R#6 are type-variables: >+ T#1 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ S#2 extends Object declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ R#3 extends S#2 declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ S#4 extends Object declared in method <S#4,T#5,R#6>max(T#5,S#4) >+ T#5 extends Comparable<S#4> declared in method <S#4,T#5,R#6>max(T#5,S#4) >+ R#6 extends S#4 declared in method <S#4,T#5,R#6>max(T#5,S#4) >+X.java:8: name clash: <T#1,S#2,R#3>max(T#1,S#2) and <S#4,T#5,R#6>max(T#5,S#4) have the same erasure >+ public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) { >+ ^ >+ where T#1,S#2,R#3,S#4,T#5,R#6 are type-variables: >+ T#1 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ S#2 extends Object declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ R#3 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2) >+ S#4 extends Object declared in method <S#4,T#5,R#6>max(T#5,S#4) >+ T#5 extends Comparable<S#4> declared in method <S#4,T#5,R#6>max(T#5,S#4) >+ R#6 extends S#4 declared in method <S#4,T#5,R#6>max(T#5,S#4) >+X.java:3: warning: [unchecked] unchecked cast >+ return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2); >+ ^ >+ required: R >+ found: Object >+ where R,S,T are type-variables: >+ R extends S declared in method <S,T,R>max(T,S) >+ S extends Object declared in method <S,T,R>max(T,S) >+ T extends Comparable<S> declared in method <S,T,R>max(T,S) >+X.java:6: warning: [unchecked] unchecked cast >+ return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2); >+ ^ >+ required: R >+ found: Object >+ where R,T,S are type-variables: >+ R extends S declared in method <T,S,R>max(T,S) >+ T extends Comparable<S> declared in method <T,S,R>max(T,S) >+ S extends Object declared in method <T,S,R>max(T,S) >+X.java:9: warning: [unchecked] unchecked cast >+ return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2); >+ ^ >+ required: R >+ found: Object >+ where R,T,S are type-variables: >+ R extends Comparable<S> declared in method <T,S,R>max(T,S) >+ T extends Comparable<S> declared in method <T,S,R>max(T,S) >+ S extends Object declared in method <T,S,R>max(T,S) >+4 errors >+3 warnings >+ */ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536 > public void test1182() { >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.66 >diff -u -r1.66 AmbiguousMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 28 Apr 2009 17:17:37 -0000 1.66 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 11 Sep 2009 18:32:29 -0000 >@@ -11,8 +11,6 @@ > package org.eclipse.jdt.core.tests.compiler.regression; > > import junit.framework.*; >-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >-import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > > public class AmbiguousMethodTest extends AbstractComparableTest { > >@@ -231,7 +229,6 @@ > } > public void test005() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -245,17 +242,30 @@ > "class A {}\n" + > "class B {}\n" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 5)\n" + >- " new X().foo();\n" + >- " ^^^\n" + >- "The method foo() is ambiguous for the type X\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " <S extends A> void foo() { }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " <N extends B> N foo() { return null; }\n" + >+ " ^^^^^\n" + >+ "Duplicate method foo() in type X\n" + > "----------\n" > ); >+/* javac 7 >+X.java:3: name clash: <N>foo() and <S>foo() have the same erasure >+ <N extends B> N foo() { return null; } >+ ^ >+ where N,S are type-variables: >+ N extends B declared in method <N>foo() >+ S extends A declared in method <S>foo() >+1 error >+ */ > } > public void test006() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "X.java", >@@ -273,17 +283,60 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " new Y<Object>().foo(\"X\");\n" + >- " ^^^\n" + >- "The method foo(Object) is ambiguous for the type Y<Object>\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >- " new Y<Object>().foo2(\"X\");\n" + >- " ^^^^\n" + >- "The method foo2(Object) is ambiguous for the type Y<Object>\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " new Y<Object>().foo(\"X\");\n" + >+ " ^^^\n" + >+ "The method foo(Object) is ambiguous for the type Y<Object>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " new Y<Object>().foo2(\"X\");\n" + >+ " ^^^^\n" + >+ "The method foo2(Object) is ambiguous for the type Y<Object>\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 10)\n" + >+ " void foo(T2 t) {}\n" + >+ " ^^^^^^^^^\n" + >+ "Name clash: The method foo(T2) of type Y<T2> has the same erasure as foo(U1) of type X<T> but does not override it\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 11)\n" + >+ " <U3> void foo2(T2 t) {}\n" + >+ " ^^^^^^^^^^\n" + >+ "Name clash: The method foo2(T2) of type Y<T2> has the same erasure as foo2(U2) of type X<T> but does not override it\n" + > "----------\n" > ); >+/* javac 7 >+X.java:3: reference to foo is ambiguous, both method <U1>foo(U1) in X and method >+ foo(T2) in Y match >+ new Y<Object>().foo("X"); >+ ^ >+ where U1,T2 are type-variables: >+ U1 extends Object declared in method <U1>foo(U1) >+ T2 extends Object declared in class Y >+X.java:4: reference to foo2 is ambiguous, both method <U2>foo2(U2) in X and meth >+od <U3>foo2(T2) in Y match >+ new Y<Object>().foo2("X"); >+ ^ >+ where U2,U3,T2 are type-variables: >+ U2 extends Object declared in method <U2>foo2(U2) >+ U3 extends Object declared in method <U3>foo2(T2) >+ T2 extends Object declared in class Y >+X.java:10: name clash: foo(T2) in Y and <U1>foo(U1) in X have the same erasure, >+yet neither overrides the other >+ void foo(T2 t) {} >+ ^ >+ where T2,U1 are type-variables: >+ T2 extends Object declared in class Y >+ U1 extends Object declared in method <U1>foo(U1) >+X.java:11: name clash: <U3>foo2(T2) in Y and <U2>foo2(U2) in X have the same era >+sure, yet neither overrides the other >+ <U3> void foo2(T2 t) {} >+ ^ >+ where U3,T2,U2 are type-variables: >+ U3 extends Object declared in method <U3>foo2(T2) >+ T2 extends Object declared in class Y >+ U2 extends Object declared in method <U2>foo2(U2) >+4 errors >+ */ > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129056 > public void test007() { >@@ -396,18 +449,14 @@ > " }\n" + > "}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 4)\n" + >- " static <L1 extends Listener & ErrorListener> Object createParser(L1 l) { return null; }\n" + >- " ^^^^^^^^^^^^^^^^^^\n" + >- "Method createParser(L1) has the same erasure createParser(X.Listener) as another method in type X\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 5)\n" + >- " static <L2 extends ErrorListener & Listener> Object createParser(L2 l) { return null; }\n" + >- " ^^^^^^^^^^^^^^^^^^\n" + >- "Method createParser(L2) has the same erasure createParser(X.ErrorListener) as another method in type X\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 8)\n" + >+ " createParser(new A());\n" + >+ " ^^^^^^^^^^^^\n" + >+ "The method createParser(A) is ambiguous for the type X\n" + > "----------\n" > ); >+// javac 7 randomly picks which ever method is second > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024 > public void test010b() { >@@ -480,8 +529,7 @@ > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106090 > public void test011a() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "Combined.java", > "public class Combined<A, B> {\n" + >@@ -495,13 +543,31 @@ > "class ExOne extends Exception {static final long serialVersionUID = 1;}\n" + > "class ExTwo extends Exception {static final long serialVersionUID = 2;}" > }, >- "" >+ "----------\n" + >+ "1. ERROR in Combined.java (at line 2)\n" + >+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method pickOne(T) has the same erasure pickOne(Comparable<T>) as another method in type Combined<A,B>\n" + >+ "----------\n" + >+ "2. ERROR in Combined.java (at line 3)\n" + >+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method pickOne(Comparable<T>) has the same erasure pickOne(Comparable<T>) as another method in type Combined<A,B>\n" + >+ "----------\n" > ); >+/* javac 7 >+X.java:3: name clash: <T#1>pickOne(Comparable<T#1>) and <T#2>pickOne(T#2) have the same erasure >+ <T> T pickOne(Comparable<T> value) throws ExTwo { return null;} >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends Object declared in method <T#1>pickOne(Comparable<T#1>) >+ T#2 extends Comparable<T#2> declared in method <T#2>pickOne(T#2) >+1 error >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106090 > public void test011b() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( > new String[] { > "Test1.java", >@@ -513,18 +579,45 @@ > "class ExOne extends Exception {static final long serialVersionUID = 1;}\n" + > "class ExTwo extends Exception {static final long serialVersionUID = 2;}" > }, >- "----------\n" + >- "1. WARNING in Test1.java (at line 4)\n" + >- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" + >- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >- "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" + >- "----------\n" + >- "2. WARNING in Test1.java (at line 4)\n" + >- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" + >- " ^^^^^^^^^^\n" + >- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" + >+ "----------\n" + >+ "1. ERROR in Test1.java (at line 2)\n" + >+ " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method pickOne(T) has the same erasure pickOne(Comparable<T>) as another method in type Test1<AA,BB>\n" + >+ "----------\n" + >+ "2. ERROR in Test1.java (at line 3)\n" + >+ " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method pickOne(Comparable<T>) has the same erasure pickOne(Comparable<T>) as another method in type Test1<AA,BB>\n" + >+ "----------\n" + >+ "3. WARNING in Test1.java (at line 4)\n" + >+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" + >+ "----------\n" + >+ "4. WARNING in Test1.java (at line 4)\n" + >+ " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" + >+ " ^^^^^^^^^^\n" + >+ "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" + > "----------\n" > ); >+/* javac 7 >+X.java:3: name clash: <T#1>pickOne(Comparable<T#1>) and <T#2>pickOne(T#2) have the same erasure >+ <T> T pickOne(Comparable<T> value) throws ExTwo { return null;} >+ ^ >+ where T#1,T#2 are type-variables: >+ T#1 extends Object declared in method <T#1>pickOne(Comparable<T#1>) >+ T#2 extends Comparable<T#2> declared in method <T#2>pickOne(T#2) >+X.java:4: warning: [unchecked] unchecked method invocation: method pickOne in class Test1 is applied to given types >+ void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) "test"); } >+ ^ >+ required: T >+ found: Comparable >+ where T is a type-variable: >+ T extends Comparable<T> declared in method <T>pickOne(T) >+1 error >+1 warning >+ */ > } > public void test012() { > this.runConformTest( >@@ -1465,8 +1558,7 @@ > // variant: having both methods in the same class should not change anything > public void test021() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; >- this.runConformTest( >+ this.runNegativeTest( > new String[] { > "Y.java", > "class X<T extends Object> {\n" + >@@ -1488,77 +1580,173 @@ > " }\n" + > "}" > }, >- "true"); >+ "----------\n" + >+ "1. WARNING in Y.java (at line 3)\n" + >+ " public class Y<V extends String> extends X<V> {\n" + >+ " ^^^^^^\n" + >+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" + >+ "----------\n" + >+ "2. WARNING in Y.java (at line 4)\n" + >+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" + >+ " ^^^^^^\n" + >+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" + >+ "----------\n" + >+ "3. ERROR in Y.java (at line 4)\n" + >+ " public static <W extends String> Y<W> make(Class<W> clazz) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method make(Class<W>) has the same erasure make(Class<T>) as another method in type Y<V>\n" + >+ "----------\n" + >+ "4. ERROR in Y.java (at line 8)\n" + >+ " public static <U extends Object> X<U> make(Class<U> clazz) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method make(Class<U>) has the same erasure make(Class<T>) as another method in type Y<V>\n" + >+ "----------\n" + >+ "5. WARNING in Y.java (at line 13)\n" + >+ " Y.make(getClazz());\n" + >+ " ^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: Unchecked invocation make(Class) of the generic method make(Class<W>) of type Y\n" + >+ "----------\n" + >+ "6. WARNING in Y.java (at line 13)\n" + >+ " Y.make(getClazz());\n" + >+ " ^^^^^^^^^^\n" + >+ "Type safety: The expression of type Class needs unchecked conversion to conform to Class<String>\n" + >+ "----------\n" + >+ "7. WARNING in Y.java (at line 15)\n" + >+ " public static Class getClazz() {\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:8: name clash: <U>make(Class<U>) and <W>make(Class<W>) have the same erasure >+ public static <U extends Object> X<U> make(Class<U> clazz) { >+ ^ >+ where U,W are type-variables: >+ U extends Object declared in method <U>make(Class<U>) >+ W extends String declared in method <W>make(Class<W>) >+X.java:13: warning: [unchecked] unchecked conversion >+ Y.make(getClazz()); >+ ^ >+ required: Class<W#1> >+ found: Class >+ where W#1,W#2 are type-variables: >+ W#1 extends String declared in method <W#2>make(Class<W#2>) >+ W#2 extends String declared in method <W#2>make(Class<W#2>) >+X.java:13: warning: [unchecked] unchecked method invocation: method make in class Y is applied to given types >+ Y.make(getClazz()); >+ ^ >+ required: Class<W> >+ found: Class >+ where W is a type-variable: >+ W extends String declared in method <W>make(Class<W>) >+1 error >+2 warnings >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647 > // variant: using instances triggers raw methods, which are ambiguous > public void test022() { > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 >- if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; > this.runNegativeTest( >- new String[] { >- "X.java", >- "public class X<T extends Object> {\n" + >- "}\n" + >- "class Y<V extends String> extends X<V> {\n" + >- " public <W extends String> Y<W> make(Class<W> clazz) {\n" + >- " return new Y<W>();\n" + >- " }\n" + >- " public <U extends Object> X<U> make(Class<U> clazz) {\n" + >- " return new X<U>();\n" + >- " }\n" + >- " public static void main(String[] args) throws Exception {\n" + >- " Y y = new Y();\n" + >- " y.make(String.class);\n" + >- " y.make(getClazz());\n" + >- " y.make(getClazz().newInstance().getClass());\n" + >- " }\n" + >- " public static Class getClazz() {\n" + >- " return String.class;\n" + >- " }\n" + >- "}" >- }, >- "----------\n" + >- "1. WARNING in X.java (at line 3)\n" + >- " class Y<V extends String> extends X<V> {\n" + >- " ^^^^^^\n" + >- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 4)\n" + >- " public <W extends String> Y<W> make(Class<W> clazz) {\n" + >- " ^^^^^^\n" + >- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 11)\n" + >- " Y y = new Y();\n" + >- " ^\n" + >- "Y is a raw type. References to generic type Y<V> should be parameterized\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 11)\n" + >- " Y y = new Y();\n" + >- " ^\n" + >- "Y is a raw type. References to generic type Y<V> should be parameterized\n" + >- "----------\n" + >- "5. ERROR in X.java (at line 12)\n" + >- " y.make(String.class);\n" + >- " ^^^^\n" + >- "The method make(Class) is ambiguous for the type Y\n" + >- "----------\n" + >- "6. ERROR in X.java (at line 13)\n" + >- " y.make(getClazz());\n" + >- " ^^^^\n" + >- "The method make(Class) is ambiguous for the type Y\n" + >- "----------\n" + >- "7. ERROR in X.java (at line 14)\n" + >- " y.make(getClazz().newInstance().getClass());\n" + >- " ^^^^\n" + >- "The method make(Class) is ambiguous for the type Y\n" + >- "----------\n" + >- "8. WARNING in X.java (at line 16)\n" + >- " public static Class getClazz() {\n" + >- " ^^^^^\n" + >- "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >- "----------\n"); >+ new String[] { >+ "X.java", >+ "public class X<T extends Object> {\n" + >+ "}\n" + >+ "class Y<V extends String> extends X<V> {\n" + >+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" + >+ " return new Y<W>();\n" + >+ " }\n" + >+ " public <U extends Object> X<U> make(Class<U> clazz) {\n" + >+ " return new X<U>();\n" + >+ " }\n" + >+ " public static void main(String[] args) throws Exception {\n" + >+ " Y y = new Y();\n" + >+ " y.make(String.class);\n" + >+ " y.make(getClazz());\n" + >+ " y.make(getClazz().newInstance().getClass());\n" + >+ " }\n" + >+ " public static Class getClazz() {\n" + >+ " return String.class;\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " class Y<V extends String> extends X<V> {\n" + >+ " ^^^^^^\n" + >+ "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 4)\n" + >+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" + >+ " ^^^^^^\n" + >+ "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " public <W extends String> Y<W> make(Class<W> clazz) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method make(Class<W>) has the same erasure make(Class<T>) as another method in type Y<V>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " public <U extends Object> X<U> make(Class<U> clazz) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Method make(Class<U>) has the same erasure make(Class<T>) as another method in type Y<V>\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 11)\n" + >+ " Y y = new Y();\n" + >+ " ^\n" + >+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 11)\n" + >+ " Y y = new Y();\n" + >+ " ^\n" + >+ "Y is a raw type. References to generic type Y<V> should be parameterized\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 12)\n" + >+ " y.make(String.class);\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" + >+ "----------\n" + >+ "8. WARNING in X.java (at line 13)\n" + >+ " y.make(getClazz());\n" + >+ " ^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" + >+ "----------\n" + >+ "9. WARNING in X.java (at line 14)\n" + >+ " y.make(getClazz().newInstance().getClass());\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety: The method make(Class) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" + >+ "----------\n" + >+ "10. WARNING in X.java (at line 16)\n" + >+ " public static Class getClazz() {\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" >+ ); >+/* javac 7 >+X.java:7: name clash: <U>make(Class<U>) and <W>make(Class<W>) have the same erasure >+ public <U extends Object> X<U> make(Class<U> clazz) { >+ ^ >+ where U,W are type-variables: >+ U extends Object declared in method <U>make(Class<U>) >+ W extends String declared in method <W>make(Class<W>) >+X.java:12: warning: [unchecked] unchecked call to <W>make(Class<W>) as a member of the raw type Y >+ y.make(String.class); >+ ^ >+ where W is a type-variable: >+ W extends String declared in method <W>make(Class<W>) >+X.java:13: warning: [unchecked] unchecked call to <W>make(Class<W>) as a member of the raw type Y >+ y.make(getClazz()); >+ ^ >+ where W is a type-variable: >+ W extends String declared in method <W>make(Class<W>) >+X.java:14: warning: [unchecked] unchecked call to <W>make(Class<W>) as a member of the raw type Y >+ y.make(getClazz().newInstance().getClass()); >+ ^ >+ where W is a type-variable: >+ W extends String declared in method <W>make(Class<W>) >+1 error >+3 warnings >+ */ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=159711 > public void test023() {
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 289247
:
146981
| 146982