我已经在Zulu openJDK 1.7.65中执行了我的应用程序的测试用例,它抛出了java.lang.Verify错误。
现在我知道我们可以使用-XX:UseSplitVerifier ot -noverify来避免这种情况,但我不想这样做。
有趣的是,当我尝试使用Zulu打开JDK 1.7.45(较低版本)执行相同的测试用例时,验证错误消失了。
如何在较新版本的zulu(即1.7.65)中解决此错误。
干杯!!!
下面的例外情况,
java.lang.VerifyError: Bad <init> method call from inside of a branch
Exception Details:
Location:
com/example/it/xyz/policy/model/GroupStep.<init>(Lorg/powermock/core/IndicateReloadClass;)V @42: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: 2a2b 4e4d 1300 4eb8 0018 04bd 000d 5903
0000010: 2d53 1301 a5b8 0033 b800 373a 0519 05b2
0000020: 0029 a500 0e2a 01c0 0039 b700 3ca7 000a
0000030: 2c2d b700 3c01 57b1
Stackmap Table:
full_frame(@48,{UninitializedThis,Object[#57],UninitializedThis,Object[#57],Top,Object[#13]},{})
full_frame(@55,{Object[#2],Object[#57],Object[#2],Object[#57],Top,Object[#13]},{})
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2532)
at java.lang.Class.getDeclaredConstructors(Class.java:1901)
at org.mockito.internal.creation.jmock.ClassImposterizer.setConstructorsAccessible(ClassImposterizer.java:75)
at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:70)
at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:111)
at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:60)
at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:143)