Class StaticInitMerger


  • public class StaticInitMerger
    extends ClassVisitor
    A ClassVisitor that merges <clinit> methods into a single one. All the existing <clinit> methods are renamed, and a new one is created, which calls all the renamed methods.
    Author:
    Eric Bruneton
    • Constructor Detail

      • StaticInitMerger

        public StaticInitMerger​(String prefix,
                                ClassVisitor classVisitor)
        Constructs a new StaticInitMerger. Subclasses must not use this constructor. Instead, they must use the StaticInitMerger(int, String, ClassVisitor) version.
        Parameters:
        prefix - the prefix to use to rename the existing <clinit> methods.
        classVisitor - the class visitor to which this visitor must delegate method calls. May be null.
      • StaticInitMerger

        protected StaticInitMerger​(int api,
                                   String prefix,
                                   ClassVisitor classVisitor)
        Constructs a new StaticInitMerger.
        Parameters:
        api - the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
        prefix - the prefix to use to rename the existing <clinit> methods.
        classVisitor - the class visitor to which this visitor must delegate method calls. May be null.