The signature
parameter of all visit…
methods refers to the generic signature, which is relevant to Reflection only at runtime. You should have noticed, that the class visit method has a name
parameter which is much more relevant to the name of the class, which is what you want to change.
For the members, it’s not so obvious that the desc
parameter is what the JVM specification calls “signature”, but at least, the ASM API is consistent in calling the generic signature description parameters signature
. That’s why the signature
can be null
, which indicates that there are no generic types involved. For what you want to achieve, you have to adapt the desc
parameter.
Further, note that when processing the instructions, you not only have to care for converting the owner type of referred members, the types of the members have to be adapted too. It’s not helpful to name the parameters arg0, arg1, arg2, arg3, arg4
in this context, by the way. There might be additional type references you are not processing, e.g. ldc
instructions may push a Class
reference, but I don’t know whether this matters for this specific case.