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 127568 Details for
Bug 267088
[1.5][compiler] Misleading error message in case of inherited methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and testcase
patch.txt (text/plain), 2.90 KB, created by
Kent Johnson
on 2009-03-04 16:59:50 EST
(
hide
)
Description:
Proposed patch and testcase
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-03-04 16:59:50 EST
Size:
2.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.175 >diff -u -r1.175 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 13 Feb 2009 21:40:03 -0000 1.175 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 4 Mar 2009 21:58:46 -0000 >@@ -9461,4 +9461,21 @@ > "----------\n" > ); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=267088 >+public void test185() { >+ this.runNegativeTest( >+ new String[] { >+ "A.java", >+ "interface I { I hello(); }\n" + >+ "interface J { J hello(); }\n" + >+ "class A implements I, J {}" >+ }, >+ "----------\n" + >+ "1. ERROR in A.java (at line 3)\n" + >+ " class A implements I, J {}\n" + >+ " ^\n" + >+ "The type A must implement the inherited abstract method I.hello()\n" + >+ "----------\n" >+ ); >+} > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v >retrieving revision 1.102 >diff -u -r1.102 MethodVerifier.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 26 Feb 2009 18:47:26 -0000 1.102 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 4 Mar 2009 21:58:47 -0000 >@@ -326,9 +326,10 @@ > MethodBinding concreteMethod = this.type.isInterface() || methods[0].isAbstract() ? null : methods[0]; > if (concreteMethod == null) { > MethodBinding bestAbstractMethod = length == 1 ? methods[0] : findBestInheritedAbstractMethod(methods, length); >- if (bestAbstractMethod == null) { >- problemReporter().inheritedMethodsHaveIncompatibleReturnTypes(this.type, methods, length); >- } else if (mustImplementAbstractMethod(bestAbstractMethod.declaringClass)) { >+ boolean noMatch = bestAbstractMethod == null; >+ if (noMatch) >+ bestAbstractMethod = methods[0]; >+ if (mustImplementAbstractMethod(bestAbstractMethod.declaringClass)) { > TypeDeclaration typeDeclaration = this.type.scope.referenceContext; > MethodBinding superclassAbstractMethod = methods[0]; > if (superclassAbstractMethod == bestAbstractMethod || superclassAbstractMethod.declaringClass.isInterface()) { >@@ -346,6 +347,8 @@ > problemReporter().abstractMethodMustBeImplemented(this.type, bestAbstractMethod, superclassAbstractMethod); > } > } >+ } else if (noMatch) { >+ problemReporter().inheritedMethodsHaveIncompatibleReturnTypes(this.type, methods, length); > } > return; > }
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 267088
: 127568