public class InstrumentingClassWriter
extends org.objectweb.asm.ClassWriter
ClassWriter implementation that verifies classes by comparing type information obtained from loading the classes as resources. This was taken from the ASM ClassWriter unit tests.
Constructor and Description |
---|
InstrumentingClassWriter(ClassNodeProvider classNodeProvider,
org.objectweb.asm.tree.ClassNode classNode)
Preserve stack map frames for V51 and newer bytecode.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getCommonSuperClass(String type1,
String type2)
Returns the common super type of the two given types without actually loading the classes in the ClassLoader.
|
getClassLoader, newClass, newConst, newConstantDynamic, newField, newHandle, newHandle, newInvokeDynamic, newMethod, newMethodType, newModule, newNameType, newPackage, newUTF8, toByteArray, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitSource, visitTypeAnnotation
public InstrumentingClassWriter(ClassNodeProvider classNodeProvider, org.objectweb.asm.tree.ClassNode classNode)
Preserve stack map frames for V51 and newer bytecode. This fixes class verification errors for JDK7 and JDK8. The option to disable bytecode verification was removed in JDK8.
Don’t bother for V50 and earlier bytecode, because it doesn’t contain stack map frames, and also because ASM’s stack map frame handling doesn’t support the JSR and RET instructions present in legacy bytecode.