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 149016 Details for
Bug 286228
[1.5][compiler] Generics inconsistencies possible regression
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and testcase
patch.txt (text/plain), 3.79 KB, created by
Kent Johnson
on 2009-10-07 14:04:53 EDT
(
hide
)
Description:
Proposed patch and testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-10-07 14:04:53 EDT
Size:
3.79 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.102 >diff -u -r1.102 MethodVerifier15.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 11 Sep 2009 18:34:56 -0000 1.102 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 7 Oct 2009 18:07:21 -0000 >@@ -477,7 +477,14 @@ > if (index > 0) { > MethodBinding first = matchingInherited[0]; > int count = index + 1; >- while (--count > 0 && areReturnTypesCompatible(first, matchingInherited[count])){/*empty*/} >+ while (--count > 0) { >+ MethodBinding match = matchingInherited[count]; >+ if (areReturnTypesCompatible(first, match)) continue; >+ // unrelated interfaces - check to see if return types are compatible >+ if (first.declaringClass.isInterface() && match.declaringClass.isInterface() && areReturnTypesCompatible(match, first)) >+ continue; >+ break; >+ } > if (count > 0) { // All inherited methods do NOT have the same vmSignature > problemReporter().inheritedMethodsHaveIncompatibleReturnTypes(typeParameter, matchingInherited, index + 1); > continue nextSelector; >#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.192 >diff -u -r1.192 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 24 Sep 2009 19:35:05 -0000 1.192 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 7 Oct 2009 18:07:23 -0000 >@@ -2041,14 +2041,22 @@ > new String[] { > "X.java", > "interface I { String foo(); }\n" + >- "class A { public Object foo() { return null; } }" + >- "public class X<T extends A&I> {}\n" >+ "class A { public Object foo() { return null; } }\n" + >+ "public class X<T extends A&I> {}\n" + >+ "interface J extends I { Object foo(); }\n" + >+ "class Y<T extends I&J> {}\n" + >+ "class Z<T extends J&I> {}" > }, >- "----------\n" + >- "1. ERROR in X.java (at line 2)\r\n" + >- " class A { public Object foo() { return null; } }public class X<T extends A&I> {}\r\n" + >- " ^\n" + >- "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " public class X<T extends A&I> {}\n" + >+ " ^\n" + >+ "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " interface J extends I { Object foo(); }\n" + >+ " ^^^^^^\n" + >+ "The return type is incompatible with I.foo()\n" + > "----------\n" > // foo() in A cannot implement foo() in I; attempting to use incompatible return type > ); >@@ -10623,4 +10631,18 @@ > 1 error > */ > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=286228 >+public void test201() { >+ this.runConformTest( >+ new String[] { >+ "A.java", >+ "interface I {}\n" + >+ "interface J<T1> { J<T1> get(); }\n" + >+ "interface K<T2 extends J<? extends I>> { T2 get(); }\n" + >+ "interface A<T3 extends K<T3> & J<? extends I>> extends J<I> {}\n" + >+ "interface B<T4 extends J<? extends I> & K<T4>> extends J<I> {}" >+ }, >+ "" >+ ); >+} > }
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 286228
:
144025
| 149016