Community
Participate
Working Groups
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) { } }; } }
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
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.