Class CustomClassWriter

  • Direct Known Subclasses:
    VerifiedClassWriter

    public class CustomClassWriter
    extends org.objectweb.asm.ClassWriter
    Custom class writer. This class works in couple with PluginStartup.init() ()} method that sets the maven classloader as the current thread classloader. Originally we faced with the problem that ClassWriter uses classes from ClassLoader to perform MethodVisitor.visitMaxs(int, int) method and if it can't find the class it throws ClassNotFoundException. To prevent this we override ClassWriter.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
    • Field Summary

      • Fields inherited from class org.objectweb.asm.ClassWriter

        COMPUTE_FRAMES, COMPUTE_MAXS
      • Fields inherited from class org.objectweb.asm.ClassVisitor

        api, cv
    • 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
      • Methods inherited from class org.objectweb.asm.ClassVisitor

        getDelegate
    • Method Detail

      • getClassLoader

        public final ClassLoader getClassLoader()
        Overrides:
        getClassLoader in class org.objectweb.asm.ClassWriter