我想将Commons Javaflow从ASM 4升级到5(与4.1相同的问题),我得到了这个例外:
java.lang.IllegalStateException: Undefined label used
at org.objectweb.asm.util.CheckMethodAdapter.visitMaxs(Unknown Source)
at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAdapter.visitMaxs (ContinuationMethodAdapter.java:313)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:140)
触发此错误的代码是:
public void visitMaxs(int maxStack, int maxLocals) {
Label endLabel = new Label();
mv.visitLabel(endLabel);
mv.visitLocalVariable("__stackRecorder", "L" + STACK_RECORDER + ";", null, startLabel, endLabel, stackRecorderVar);
mv.visitMaxs(0, 0);
}
知道如何解决这个问题吗?