Class SimpleClassWriter
- java.lang.Object
-
- org.objectweb.asm.ClassVisitor
-
- org.objectweb.asm.ClassWriter
-
- com.offbynull.coroutines.instrumenter.asm.SimpleClassWriter
-
public final class SimpleClassWriter extends org.objectweb.asm.ClassWriterAClassWriterthat overridesgetCommonSuperClass(java.lang.String, java.lang.String)such that it usesClassInformationRepositoryto derive the common super rather than querying loaded up classes.
-
-
Field Summary
Fields Modifier and Type Field Description private ClassInformationRepositoryinfoRepo
-
Constructor Summary
Constructors Constructor Description SimpleClassWriter(int flags, ClassInformationRepository infoRepo)Constructs aSimpleClassWriterobject.SimpleClassWriter(org.objectweb.asm.ClassReader classReader, int flags, ClassInformationRepository infoRepo)Constructs aSimpleClassWriterobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.LinkedHashSet<java.lang.String>flattenHierarchy(java.lang.String type)protected java.lang.StringgetCommonSuperClass(java.lang.String type1, java.lang.String type2)Derives common super class from the super name mapping passed in to the constructor.-
Methods inherited from class org.objectweb.asm.ClassWriter
getClassLoader, hasFlags, newClass, newConst, newConstantDynamic, newField, newHandle, newHandle, newInvokeDynamic, newMethod, newMethodType, newModule, newNameType, newPackage, newUTF8, setFlags, toByteArray, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
-
-
-
Field Detail
-
infoRepo
private final ClassInformationRepository infoRepo
-
-
Constructor Detail
-
SimpleClassWriter
public SimpleClassWriter(int flags, ClassInformationRepository infoRepo)Constructs aSimpleClassWriterobject. SeeClassWriter(int).- Parameters:
flags- option flags that can be used to modify the default behavior of this class. SeeClassWriter.COMPUTE_MAXS,ClassWriter.COMPUTE_FRAMES.infoRepo- class hierarchy mappings for deriving stack map frames- Throws:
java.lang.NullPointerException- if any argument isnull
-
SimpleClassWriter
public SimpleClassWriter(org.objectweb.asm.ClassReader classReader, int flags, ClassInformationRepository infoRepo)Constructs aSimpleClassWriterobject. SeeClassWriter(org.objectweb.asm.ClassReader, int).- Parameters:
classReader- theClassReaderused to read the original class. It will be used to copy the entire constant pool from the original class and also to copy other fragments of original bytecode where applicable.flags- option flags that can be used to modify the default behavior of this class. SeeClassWriter.COMPUTE_MAXS,ClassWriter.COMPUTE_FRAMES.infoRepo- class hierarchy mappings for deriving stack map frames- Throws:
java.lang.NullPointerException- if any argument isnull
-
-
Method Detail
-
getCommonSuperClass
protected java.lang.String getCommonSuperClass(java.lang.String type1, java.lang.String type2)Derives common super class from the super name mapping passed in to the constructor.- Overrides:
getCommonSuperClassin classorg.objectweb.asm.ClassWriter- Parameters:
type1- the internal name of a class.type2- the internal name of another class.- Returns:
- the internal name of the common super class of the two given classes
- Throws:
java.lang.NullPointerException- if any argument isnull
-
flattenHierarchy
private java.util.LinkedHashSet<java.lang.String> flattenHierarchy(java.lang.String type)
-
-