private byte [ ] replaceAsmInstructions ( final byte [ ] classFile , final boolean hasFrames ) { final Attribute [ ] attributes = getAttributePrototypes ( ) ; firstField = null ; lastField = null ; firstMethod = null ; lastMethod = null ; lastRuntimeVisibleAnnotation = null ; lastRuntimeInvisibleAnnotation = null ; lastRuntimeVisibleTypeAnnotation = null ; lastRuntimeInvisibleTypeAnnotation = null ; moduleWriter = null ; nestHostClassIndex = 0 ; numberOfNestMemberClasses = 0 ; nestMemberClasses = null ; firstAttribute = null ; compute = hasFrames ? MethodWriter . COMPUTE_INSERTED_FRAMES : MethodWriter . COMPUTE_NOTHING ; new ClassReader ( classFile , 0 , /* checkClassVersion = */ false ) . accept ( this , attributes , ( hasFrames ? ClassReader . EXPAND_FRAMES : 0 ) | ClassReader . EXPAND_ASM_INSNS ) ; return toByteArray ( ) ; }
Returns the equivalent of the given class file with the ASM specific instructions replaced with standard ones . This is done with a ClassReader - &gt ; ClassWriter round trip .