Virtual Extension Method bug report
Craig P. Motlin
cmotlin at gmail.com
Tue Nov 19 20:27:08 PST 2013
I've been testing jdk-8-ea-bin-b115-windows-x64-07_nov_2013 and I ran into
a problem. My program compiles and I get an AbstractMethodError when I call
a virtual extension method using the SuperClass.super.method() syntax, when
the method body is defined higher up than SuperClass.
Exception in thread "main" java.lang.AbstractMethodError:
example.EmptyInterface.method()V
at example.ConcreteCallsSuper.method(ConcreteCallsSuper.java:9)
at example.ConcreteCallsSuper.main(ConcreteCallsSuper.java:14)
Here's the code. All three interfaces seem important.
public interface AbstractMethod
{
void method();
}
public interface VirtualExtensionMethod extends AbstractMethod
{
@Override
default void method()
{
System.out.println("example.VirtualExtensionMethod.method");
}
}
public interface EmptyInterface extends VirtualExtensionMethod
{
}
public class ConcreteCallsSuper implements EmptyInterface
{
@Override
public void method()
{
System.out.println("example.ConcreteCallsSuper.method");
EmptyInterface.super.method();
}
public static void main(String[] args)
{
new ConcreteCallsSuper().method();
}
}
More information about the lambda-dev
mailing list