Blocks :
|
|
Blocks :
|
|
Duplicate :
|
JDK-8007888 :
|
|
JDK-8008185 :
|
Extend an interface with default method, existing code using that interface build with -target 1.5 will cause throwing java.lang.VerifyError with "Illegal use of nonvirtual function call". Attached is a test case to illustrate the bug. Build TestInterface.java + MyInterface.java.1.5(rename to MyInterface.java) with $ cp MyInterface.java.1.5 MyInterface.java $ javac -source 1.5 -target 1.5 TestInterface.java $java TestInterface foo Now replace MyInterface with new version, $ cp MyInterface.java.1.8 MyInterface.java $ javac MyInterace.java $ java TestInterface Exception in thread "main" java.lang.VerifyError: (class: TestInterface$1, method: bar signature: ()V) Illegal use of nonvirtual function call at TestInterface.main(TestInterface.java:3) Note that build to target 1.6 works as expected.
|