Example usage for org.objectweb.asm.commons LocalVariablesSorter visitEnd

List of usage examples for org.objectweb.asm.commons LocalVariablesSorter visitEnd

Introduction

In this page you can find the example usage for org.objectweb.asm.commons LocalVariablesSorter visitEnd.

Prototype

public void visitEnd() 

Source Link

Document

Visits the end of the method.

Usage

From source file:rubah.bytecode.transformers.AddTraverseMethod.java

License:Open Source License

private void generateTraverseMethod() {
    LocalVariablesSorter mv = new LocalVariablesSorter(TRAVERSE_METHOD_ACC_FLAGS, TRAVERSE_METHOD_DESC,
            this.visitMethod(this.getTraverseMethodAccess(), this.getTraverseMethodName(), TRAVERSE_METHOD_DESC,
                    null, null));/*from w  w  w.  j av a  2s  . c o  m*/
    mv.visitCode();

    if (isAllowed(this.thisClass.getFqn())) {
        this.generateTraverseMethodPreamble(mv);

        if (!this.fields.isEmpty()) {
            for (Pair<String, String> field : this.fields) {
                this.generateFieldAccess(mv, field);
            }
        }
    }
    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitEnd();
}