Class CustomClassWriter
- java.lang.Object
-
- org.objectweb.asm.ClassVisitor
-
- org.objectweb.asm.ClassWriter
-
- org.eolang.jeo.representation.bytecode.CustomClassWriter
-
public final class CustomClassWriter extends org.objectweb.asm.ClassWriterCustom class writer. This class works in couple withJeoMojo#initClassloader()method that sets the maven classloader as the current thread classloader. Originally we faced with the problem thatClassWriteruses 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 ClassLoadergetClassLoader()-
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 ClassLoader getClassLoader()
- Overrides:
getClassLoaderin classorg.objectweb.asm.ClassWriter
-
-