I am new to ASM and I'm trying to do a basic transformation of a class at runtime. To get me started, I'm trying to transform a class simply by changing its name by appending the word "String" to the end of it. After performing this transformation I try to instantiate an object of the newly generated class. When I run my code I get this error message:
Exception in thread "main" java.lang.VerifyError: stack shape inconsistent (class: beans/PersonString method: getName()Ljava/lang/String;) at pc: 1
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.Class.newInstanceImpl(Native Method)
This is my main method
This is my change adapter
This is my class loader
The main method fails on line 27 where I try to instantiate an object from the new class.