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 79423 Details for
Bug 204624
[1.5][compiler] No error on abstract method implementation with missing parameter generics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 3.22 KB, created by
Kent Johnson
on 2007-09-28 15:47:01 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2007-09-28 15:47:01 EDT
Size:
3.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java,v >retrieving revision 1.81 >diff -u -r1.81 MethodVerifier15.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 24 Sep 2007 22:49:54 -0000 1.81 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 28 Sep 2007 19:45:58 -0000 >@@ -43,6 +43,9 @@ > if (!areTypesEqual(oneArgs[i], twoArgs[i])) { > if (oneArgs[i].leafComponentType().isRawType()) { > if (oneArgs[i].dimensions() == twoArgs[i].dimensions() && oneArgs[i].leafComponentType().isEquivalentTo(twoArgs[i].leafComponentType())) { >+ // raw mode does not apply if the method defines its own type variables >+ if (one.typeVariables != Binding.NO_TYPE_VARIABLES) >+ return false; > // one parameter type is raw, hence all parameters types must be raw or non generic > // otherwise we have a mismatch check backwards > for (int j = 0; j < i; j++) >#P org.eclipse.jdt.core.tests.compiler >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.135 >diff -u -r1.135 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 28 Sep 2007 18:26:13 -0000 1.135 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 28 Sep 2007 19:45:59 -0000 >@@ -7987,4 +7987,38 @@ > "----------\n" > ); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=204624 >+public void test148() { >+ this.runNegativeTest( >+ new String[] { >+ "Y.java", >+ "abstract class X { abstract <T extends Object> T go(A<T> a); }\n" + >+ "class Y extends X {\n" + >+ " @Override <T extends Object> T go(A a) { return null; }\n" + >+ "}\n" + >+ "class A<T> {}" >+ }, >+ "----------\n" + >+ "1. ERROR in Y.java (at line 2)\n" + >+ " class Y extends X {\n" + >+ " ^\n" + >+ "The type Y must implement the inherited abstract method X.go(A<T>)\n" + >+ "----------\n" + >+ "2. ERROR in Y.java (at line 3)\n" + >+ " @Override <T extends Object> T go(A a) { return null; }\n" + >+ " ^^^^^^^\n" + >+ "Name clash: The method go(A) of type Y has the same erasure as go(A<T>) of type X but does not override it\n" + >+ "----------\n" + >+ "3. ERROR in Y.java (at line 3)\n" + >+ " @Override <T extends Object> T go(A a) { return null; }\n" + >+ " ^^^^^^^\n" + >+ "The method go(A) of type Y must override a superclass method\n" + >+ "----------\n" + >+ "4. WARNING in Y.java (at line 3)\n" + >+ " @Override <T extends Object> T go(A a) { return null; }\n" + >+ " ^\n" + >+ "A is a raw type. References to generic type A<T> should be parameterized\n" + >+ "----------\n" >+ ); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204624
:
79177
| 79423