The visitLdcInsn
method were there from the beginning, but some of the accepted parameter types depend on the class format version, e.g. Type
and Handle
values are acceptable for class format 51.0 and higher. See corresponding JavaDoc.
Also note, that ASM's ClassWriter
doesn't check validity of produced bytecode. You need to add CheckClassAdapter into the visitor's chain before ClassWriter
.