Summary: | Overriding method in base class with covariant return type fails with AbstractMethodError | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Daniel R Somerfield <dsomerfi> | ||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1 M6 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Daniel R Somerfield
2005-04-13 18:38:59 EDT
Created attachment 19889 [details] Test Case for bug 91355 Daniel, can you please double check the testcase. I do not get an AbstractMethodError, but the testcase also does not include any senders of the method doSomething() The I.doSomething() below is just an explanation. In the example, the method of note is ISourceInterface.get(). If I run TestMain, compiled with javac, it exits normally. If I run it from eclipse, I get: Exception in thread "main" java.lang.AbstractMethodError: test.SourceImpl.get()Ltest/IReturnInterface; at test.TestMain.main(TestMain.java:19) If I look at the generated class files, the one compiled with javac includes two methods: "<init>" with the signature "()V" and "get" with the signature "()test/IReturnInterface;" with the JDT it only has this: "<init>" with the signature "()V" What build are you running? I can run the testcase fine & if I change AbstractSource to: public abstract class AbstractSource { public ReturnImpl get() { System.out.println("AbstractSource.get()"); return new ReturnImpl(); } } I get "AbstractSource.get()" printed from both javac & Eclipse. I was running on M4. It appears to be ok in M6. Sorry for the bother. |