Class CustomClassWriter
- java.lang.Object
-
- org.objectweb.asm.ClassVisitor
-
- org.objectweb.asm.ClassWriter
-
- org.eolang.jeo.representation.bytecode.CustomClassWriter
-
- Direct Known Subclasses:
VerifiedClassWriter
public class CustomClassWriter extends org.objectweb.asm.ClassWriter
Custom class writer. This class works in couple withPluginStartup.init()
()} method that sets the maven classloader as the current thread classloader. Originally we faced with the problem thatClassWriter
uses classes from ClassLoader to performMethodVisitor.visitMaxs(int, int)
method and if it can't find the class it throwsClassNotFoundException
. To prevent this we overrideClassWriter.getClassLoader()
method and return the current thread classloader that knows about all classes that were compiled on the previous maven phases. You can read more about this problem here: - https://gitlab.ow2.org/asm/asm/-/issues/317918 - https://stackoverflow.com/questions/11292701/error-while-instrumenting-class-files-asm-classwriter-getcommonsuperclass- Since:
- 0.1
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoader
getClassLoader()
-
Methods inherited from class org.objectweb.asm.ClassWriter
getCommonSuperClass, hasFlags, 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, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
-
-
-
Method Detail
-
getClassLoader
public final ClassLoader getClassLoader()
- Overrides:
getClassLoader
in classorg.objectweb.asm.ClassWriter
-
-