Example usage for org.objectweb.asm Opcodes ASM5

List of usage examples for org.objectweb.asm Opcodes ASM5

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes ASM5.

Prototype

int ASM5

To view the source code for org.objectweb.asm Opcodes ASM5.

Click Source Link

Usage

From source file:org.evosuite.instrumentation.ExitClassInitMethodAdapter.java

License:Open Source License

/**
 * <p>Constructor for PutStaticMethodAdapter.</p>
 *
 * @param mv a {@link org.objectweb.asm.MethodVisitor} object.
 * @param className a {@link java.lang.String} object.
 * @param finalFields a {@link java.util.List} object.
 *///from   w w w. jav a 2s.c  om
public ExitClassInitMethodAdapter(String className, String methodName, MethodVisitor mv) {
    super(Opcodes.ASM5, mv);
    this.className = className;
    this.methodName = methodName;
}

From source file:org.evosuite.instrumentation.ExplicitExceptionHandler.java

License:Open Source License

/**
 * <p>//from w w  w  . j  ava2s  .  co m
 * Constructor for ExplicitExceptionHandler.
 * </p>
 * 
 * @param mv
 *            a {@link org.objectweb.asm.MethodVisitor} object.
 * @param className
 *            a {@link java.lang.String} object.
 * @param methodName
 *            a {@link java.lang.String} object.
 * @param desc
 *            a {@link java.lang.String} object.
 */
public ExplicitExceptionHandler(MethodVisitor mv, String className, String methodName, String desc) {
    super(Opcodes.ASM5, mv);
    fullMethodName = methodName + desc;
    this.className = className;
}

From source file:org.evosuite.instrumentation.JUnitCoverageMethodAdapter.java

License:Open Source License

/**
 * <p>Constructor for LineNumberMethodAdapter.</p>
 *
 * @param mv a {@link org.objectweb.asm.MethodVisitor} object.
 * @param className a {@link java.lang.String} object.
 * @param methodName a {@link java.lang.String} object.
 * @param desc a {@link java.lang.String} object.
 *///from www.  j  a  v  a  2  s  . c o m
public JUnitCoverageMethodAdapter(MethodVisitor mv, int access, String className, String methodName,
        String desc, boolean isTestClass) {
    super(Opcodes.ASM5, mv, access, methodName, desc);
    fullMethodName = methodName + desc;
    this.className = className;
    this.methodName = methodName;
    if (isTestClass) {
        // JUnit 3 test
        if (methodName.startsWith("test") || methodName.equals("setUp") || methodName.equals("tearDown"))
            this.isJUnitTest = true;
    }
    InheritanceTree tree = DependencyAnalysis.getInheritanceTree();
    if (tree != null) {
        if (tree.hasClass(Properties.TARGET_CLASS)) {
            subClasses.addAll(tree.getSubclasses(Properties.TARGET_CLASS));
            superClasses.addAll(tree.getSuperclasses(Properties.TARGET_CLASS));
        }
    }
}

From source file:org.evosuite.instrumentation.LineNumberMethodAdapter.java

License:Open Source License

/**
 * <p>Constructor for LineNumberMethodAdapter.</p>
 *
 * @param mv a {@link org.objectweb.asm.MethodVisitor} object.
 * @param className a {@link java.lang.String} object.
 * @param methodName a {@link java.lang.String} object.
 * @param desc a {@link java.lang.String} object.
 *//* w  w w .  jav  a2s  .com*/
public LineNumberMethodAdapter(MethodVisitor mv, String className, String methodName, String desc) {
    super(Opcodes.ASM5, mv);
    fullMethodName = methodName + desc;
    this.className = className;
    this.methodName = methodName;
    if (!methodName.equals("<init>"))
        hadInvokeSpecial = true;
}

From source file:org.evosuite.instrumentation.MethodEntryAdapter.java

License:Open Source License

/**
 * <p>Constructor for MethodEntryAdapter.</p>
 *
 * @param mv a {@link org.objectweb.asm.MethodVisitor} object.
 * @param access a int./*from  w  ww  . j a  v a2  s  .  c  o m*/
 * @param className a {@link java.lang.String} object.
 * @param methodName a {@link java.lang.String} object.
 * @param desc a {@link java.lang.String} object.
 */
public MethodEntryAdapter(MethodVisitor mv, int access, String className, String methodName, String desc) {
    super(Opcodes.ASM5, mv, access, methodName, desc);
    this.className = className;
    this.methodName = methodName;
    this.fullMethodName = methodName + desc;
    this.access = access;
}

From source file:org.evosuite.instrumentation.MethodSignatureCollector.java

License:Open Source License

public MethodSignatureCollector(MethodVisitor mv, String className, String methodName, String desc,
        boolean isStatic) {
    super(Opcodes.ASM5, mv);
    this.className = className;
    this.methodName = methodName;
    this.methodDesc = desc;
    numParams = Type.getArgumentTypes(desc).length;
    this.isStatic = isStatic;
    if (!isStatic) {
        startIndex = 1;//  w w w . j  ava2  s . c  om
    }
    endIndex = startIndex + numParams;
}

From source file:org.evosuite.instrumentation.NonTargetClassAdapter.java

License:Open Source License

/**
 * <p>Constructor for NonTargetClassAdapter.</p>
 *
 * @param cv a {@link org.objectweb.asm.ClassVisitor} object.
 * @param className a {@link java.lang.String} object.
 *///  ww  w.java 2 s  . c  om
public NonTargetClassAdapter(ClassVisitor cv, String className) {
    super(Opcodes.ASM5, cv);
    this.className = className;
}

From source file:org.evosuite.instrumentation.ObjectCallAdapter.java

License:Open Source License

/**
 * <p>//ww  w  .j  a v a2 s  .c om
 * Constructor for ObjectCallAdapter.
 * </p>
 * 
 * @param mv
 *            a {@link org.objectweb.asm.MethodVisitor} object.
 * @param descriptors
 *            a {@link java.util.Map} object.
 */
public ObjectCallAdapter(MethodVisitor mv, Map<String, String> descriptors) {
    super(Opcodes.ASM5, mv);
    this.descriptors = descriptors;
}

From source file:org.evosuite.instrumentation.ObjectSignatureAdapter.java

License:Open Source License

/**
 * <p>//from   w  ww . j a  v a  2 s. c o m
 * Constructor for ObjectSignatureAdapter.
 * </p>
 * 
 * @param visitor
 *            a {@link org.objectweb.asm.ClassVisitor} object.
 * @param className
 *            a {@link java.lang.String} object.
 */
public ObjectSignatureAdapter(ClassVisitor visitor, String className) {
    super(Opcodes.ASM5, visitor);

    this.className = ResourceList.getClassNameFromResourcePath(className);

    if (!(this.className.startsWith(Properties.PROJECT_PREFIX))
            && !(this.className.startsWith(Properties.TARGET_CLASS_PREFIX))) {
        exclude = true;
    } else {
        exclude = false;

        // Initialize descriptors
        // mutation-report/className.obj contains method signatures
        File file = new File(Properties.OUTPUT_DIR + "/" + className + ".obj");
        List<String> lines = FileIOUtils.readFile(file);
        descriptors = new HashMap<String, String>();
        for (String line : lines) {
            line = line.trim();
            // Skip comments
            if (line.startsWith("#"))
                continue;

            String[] parameters = line.split(",");
            if (parameters.length == 2) {
                descriptors.put(parameters[0], parameters[1]);
                logger.info("Adding descriptor: " + parameters[1]);
            } else if (parameters.length == 3) {
                // TODO: Handle signature
                descriptors.put(parameters[0], parameters[1]);
            }
        }
    }
}

From source file:org.evosuite.instrumentation.PurityAnalysisClassVisitor.java

License:Open Source License

/**
 * <p>/*from  ww w .  j a v  a 2 s  . c  o  m*/
 * Constructor for StaticInitializationClassAdapter.
 * </p>
 * 
 * @param visitor
 *            a {@link org.objectweb.asm.ClassVisitor} object.
 * @param className
 *            a {@link java.lang.String} object.
 */
public PurityAnalysisClassVisitor(ClassVisitor visitor, String className, CheapPurityAnalyzer purityAnalyzer) {
    super(Opcodes.ASM5, visitor);
    this.className = className;
    this.purityAnalyzer = purityAnalyzer;
}