You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been learning Javassist (VERSION: 3.30.2-GA)recently and have also learned how to use Bytecode content. I would like to write a simple introductory example, as follows:
But I found that the execution failed, and the error exception message thrown is as follows:
javassist.CannotCompileException: byjava.lang.ClassFormatError: Argumentscan't fit into locals in class file HelloWorld
atjavassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:271)
atjavassist.ClassPool.toClass(ClassPool.java:1240)
atjavassist.ClassPool.toClass(ClassPool.java:1098)
atjavassist.ClassPool.toClass(ClassPool.java:1056)
atjavassist.CtClass.toClass(CtClass.java:1298)
atorg.lijin.javassist.test01.Bytecode06.test01(Bytecode06.java:61)
atjava.lang.reflect.Method.invoke(Method.java:498)
atjava.util.ArrayList.forEach(ArrayList.java:1259)
atjava.util.ArrayList.forEach(ArrayList.java:1259)
Causedby: java.lang.ClassFormatError: Argumentscan't fit into locals in class file HelloWorld
atjava.lang.ClassLoader.defineClass1(NativeMethod)
atjava.lang.ClassLoader.defineClass(ClassLoader.java:757)
atjava.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
atjavassist.util.proxy.DefineClassHelper$Java7.defineClass(DefineClassHelper.java:177)
atjavassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:260)
... 8more
So I used CtMethod. make() to regenerate the class file and compared the binary content of the file, and found that there were differences between the two files:
I don't know if there is a problem with my Bytecode example or if it is a bug. Looking forward to your reply
The text was updated successfully, but these errors were encountered:
I have been learning Javassist (VERSION: 3.30.2-GA)recently and have also learned how to use Bytecode content. I would like to write a simple introductory example, as follows:
But I found that the execution failed, and the error exception message thrown is as follows:
So I used CtMethod. make() to regenerate the class file and compared the binary content of the file, and found that there were differences between the two files:
I don't know if there is a problem with my Bytecode example or if it is a bug. Looking forward to your reply
The text was updated successfully, but these errors were encountered: