gradlew test
:test
Gradle test > eu.plumbr.aClassTest.main FAILED
java.lang.VerifyError at aClassTest.java:9
1 test completed, 1 failed
:test FAILED
java.lang.VerifyError: Bad local variable type in method eu.plumbr.aClass.findCustomerReportById(J)Ljava/lang/Long; at offset 94
at eu.plumbr.aClassTest.main(aClassTest.java:9)
If I run it with provided Ant build.xml via Jacoco own ant tasks, then everything runs just fine.
Which feature does not work with the old verifier? As far as I know, the only new byte code instruction is invokedynamic but it is not used by javac (in Java7). Is there anything I missing?
Which feature does not work with the old verifier? As far as I know, the only new byte code instruction is invokedynamic but it is not used by javac (in Java7). Is there anything I missing?
Java 7 uses a new class file version (51). The split verifier is needed to verify files using the new format, even if they don’t use the invokedynamic instruction. Similarly, any java code compiled using -source 1.7 -target 1.7 uses the new class file format.
So even to use the diamond syntax, you need to compile in 1.7 mode, which means that you need to use the split verifier.
The class file format is one thing, it shouldn’t affect (in itself) the verifier. Actually, I have just tried -XX:-UseSplitVerifier with a code heavily relying on Java7 features (API and syntax) and it works well. I haven’t tried it with a byte code which uses invokedynamic though.