Bug 470006 - compiler reports unexpected "must implement the inherited abstract method"
Summary: compiler reports unexpected "must implement the inherited abstract method"
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-11 16:56 EDT by Igor Fedorenko CLA
Modified: 2022-10-21 19:28 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Fedorenko CLA 2015-06-11 16:56:30 EDT
The following code compiles with Oracle javac 1.7.0_65 and 1.8.0_40, but gets "The type new AbstractType(){} must implement the inherited abstract method ICallable.call(Object)" error marker in eclipse


    public interface ICallable<R, P, E extends Exception> {
      R call(P p) throws E;
    }


    public class ArgumentType<E extends Exception> {
    }

    public abstract class AbstractType<E extends Exception>
        implements ICallable<String, ArgumentType<E>, E> {
    
      @Override
      public String call(ArgumentType p) throws E {
        return null;
      }
    
      public abstract void anotherCall(ArgumentType<E> p);
    }

    public class AbstractTypeTest {
      public void test() {
        AbstractType testee = new AbstractType() {
    //                            ^^^^^^^^^^^^^ error marker is here
          public void anotherCall(ArgumentType p) {
          }
        };
      }
    }
Comment 1 Sasikanth Bharadwaj CLA 2015-06-12 01:46:16 EDT
The use of the raw types causes the problem. Changing the signature of call to 
 public String call(ArgumentType<E> p) throws E solves it. Or specifying a bound for AbstractType in AbstractTypeTest like 
 AbstractType<Exception> testee = new AbstractType<Exception>() {...} does it as well.

This error occurs in 4.2.2 as well and I cannot comment on this from a JLS point of view. But the use of raw types is discouraged because they cause grief to the compiler, so I'm not entirely sure this is a bug in eclipse
Comment 2 Eclipse Genie CLA 2020-05-24 20:10:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2022-10-21 19:28:05 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.