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 56896 Details for
Bug 168331
[1.5][compiler] AbstractMethodError on interface method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Smaller fix only addresses regression
org.eclipse.jdt.core_04.txt (text/plain), 9.31 KB, created by
Maxime Daniel
on 2007-01-15 07:15:19 EST
(
hide
)
Description:
Smaller fix only addresses regression
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2007-01-15 07:15:19 EST
Size:
9.31 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.64 >diff -u -r1.64 MethodVerifier15.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 21 Dec 2006 19:22:05 -0000 1.64 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 15 Jan 2007 11:57:50 -0000 >@@ -552,14 +552,15 @@ > // one has type variables and substituteTwo did not pass bounds check in computeSubstituteMethod() > return one.typeVariables != Binding.NO_TYPE_VARIABLES && !(substituteTwo instanceof ParameterizedGenericMethodBinding); > } >+// caveat: returns false if a method is implemented but needs that a bridge >+// method be generated > boolean isInterfaceMethodImplemented(MethodBinding inheritedMethod, MethodBinding existingMethod, ReferenceBinding superType) { > if (inheritedMethod.original() != inheritedMethod && existingMethod.declaringClass.isInterface()) > return false; // must hold onto ParameterizedMethod to see if a bridge method is necessary > > inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod); > return inheritedMethod != null >- && (inheritedMethod.returnType == existingMethod.returnType || >- inheritedMethod.returnType.isCompatibleWith(inheritedMethod.returnType)) >+ && inheritedMethod.returnType == existingMethod.returnType > && super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType); > } > SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) { >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java,v >retrieving revision 1.18 >diff -u -r1.18 InnerEmulationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 11 Jan 2007 08:52:58 -0000 1.18 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 15 Jan 2007 11:58:04 -0000 >@@ -5347,7 +5347,7 @@ > "----------\n"); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331 >-public void _test133() { >+public void test133() { > if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) { > this.runConformTest( > new String[] { >@@ -5382,7 +5382,7 @@ > } > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331 >-public void _test134() { >+public void test134() { > if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) { > this.runConformTest( > new String[] { >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.108 >diff -u -r1.108 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 21 Dec 2006 19:41:39 -0000 1.108 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 15 Jan 2007 11:58:06 -0000 >@@ -708,14 +708,19 @@ > "abstract class X2 extends A implements J {}\n" > }, > "----------\n" + >- "1. ERROR in A.java (at line 2)\r\n" + >- " interface I extends J { Object foo(); }\r\n" + >+ "1. ERROR in A.java (at line 1)\n" + >+ " abstract class A implements I {}\n" + >+ " ^\n" + >+ "The return type is incompatible with J.foo(), I.foo()\n" + >+ "----------\n" + >+ "2. ERROR in A.java (at line 2)\n" + >+ " interface I extends J { Object foo(); }\n" + > " ^^^^^^\n" + > "The return type is incompatible with J.foo()\n" + > "----------\n" + > "----------\n" + >- "1. ERROR in X.java (at line 1)\r\n" + >- " abstract class X2 extends A implements J {}\r\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " abstract class X2 extends A implements J {}\n" + > " ^^\n" + > "The return type is incompatible with I.foo(), J.foo()\n" + > "----------\n" >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.583 >diff -u -r1.583 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 12 Jan 2007 14:19:42 -0000 1.583 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 15 Jan 2007 11:58:03 -0000 >@@ -31465,22 +31465,32 @@ > }, > "S100MyClass = [Terry]MyClass = [Corbet]SUCCESS"); > } >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643 >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643 > public void test0987() { > String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6 > ? "----------\n" + >- "1. ERROR in X.java (at line 11)\n" + >+ "1. ERROR in X.java (at line 7)\n" + >+ " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 11)\n" + > " public ISheetViewer getViewer() { return null; } \n" + > " ^^^^^^^^^^^^\n" + > "The return type is incompatible with EditPart.getViewer()\n" + > "----------\n" + >- "2. ERROR in X.java (at line 11)\n" + >+ "3. ERROR in X.java (at line 11)\n" + > " public ISheetViewer getViewer() { return null; } \n" + > " ^^^^^^^^^^^\n" + > "The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" + > "----------\n" > : "----------\n" + >- "1. ERROR in X.java (at line 11)\n" + >+ "1. ERROR in X.java (at line 7)\n" + >+ " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 11)\n" + > " public ISheetViewer getViewer() { return null; } \n" + > " ^^^^^^^^^^^^\n" + > "The return type is incompatible with EditPart.getViewer()\n" + >@@ -31521,7 +31531,7 @@ > }, > expectedOutput); > } >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643 - variation >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643 - variation > public void test0988() { > this.runNegativeTest( > new String[] { >@@ -31572,7 +31582,7 @@ > "1. ERROR in X.java (at line 7)\n" + > " abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + > " ^^^^^^^^^^^^^^^^\n" + >- "The return type is incompatible with AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + >+ "The return type is incompatible with ILinkViewElement.getViewer(), AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + > "----------\n" + > "2. ERROR in X.java (at line 11)\n" + > " public SheetViewer getViewer() { return null; } \n" + >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.34 >diff -u -r1.34 AmbiguousMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 4 Dec 2006 09:06:28 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 15 Jan 2007 11:57:53 -0000 >@@ -1474,7 +1474,28 @@ > ""); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073 >-// variant that passes >+// variant that shows that the use of a substitution is needed during the bounds >+// check >+public void _test032a() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "class Z { }\n" + >+ "class Y <U> extends Z { }" + >+ "interface I {\n" + >+ " <T extends Y<T> & Cloneable> T foo(Number n);\n" + >+ "}\n" + >+ "interface J extends I {\n" + >+ " XX foo(Number n);\n" + >+ "}\n" + >+ "public abstract class X implements J {\n" + >+ "}\n" + >+ "abstract class XX extends Y<XX> implements Cloneable {}" >+ }, >+ ""); >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073 >+// variant > public void test033() { > this.runConformTest( > new String[] { >@@ -1524,7 +1545,7 @@ > "2. ERROR in X.java (at line 10)\n" + > " public abstract class X implements J, K {\n" + > " ^\n" + >- "The return type is incompatible with K.foo(Number), J.foo(Number)\n" + >+ "The return type is incompatible with I.foo(Number), K.foo(Number), J.foo(Number)\n" + > "----------\n"); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
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 168331
:
56701
|
56796
| 56896