Package org.objectweb.asm

Examples of org.objectweb.asm.ClassWriter.visit()


    final String className = "org/jacoco/test/targets/RuntimeTestTarget_"
        + classid;
    Type classType = Type.getObjectType(className);

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null,
        "java/lang/Object", new String[] { Type
            .getInternalName(ITarget.class) });

    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);
View Full Code Here


    final String className = "org/jacoco/test/targets/RuntimeTestTarget_"
        + classid;
    Type classType = Type.getObjectType(className);

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null,
        "java/lang/Object", new String[] { Type
            .getInternalName(ITarget.class) });

    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);
View Full Code Here

    final String className = "org/jacoco/test/targets/RuntimeTestTarget_"
        + classid;
    Type classType = Type.getObjectType(className);

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null,
        "java/lang/Object",
        new String[] { Type.getInternalName(ITarget.class) });

    writer.visitField(InstrSupport.DATAFIELD_ACC,
        InstrSupport.DATAFIELD_NAME, InstrSupport.DATAFIELD_DESC, null,
View Full Code Here

  }

  @Test
  public void testGenerateArgumentArray() throws Exception {
    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Sample", null,
        "java/lang/Object",
        new String[] { Type.getInternalName(Callable.class) });

    // Constructor
    MethodVisitor mv = writer.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
View Full Code Here

  public void testGenerateAccessCall() throws Exception {
    final boolean[] data = store.get(Long.valueOf(1234), "Sample", 5)
        .getData();

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Sample", null,
        "java/lang/Object",
        new String[] { Type.getInternalName(Callable.class) });

    // Constructor
    MethodVisitor mv = writer.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
View Full Code Here

    final String className = "org/jacoco/test/targets/RuntimeTestTarget_"
        + classid;
    Type classType = Type.getObjectType(className);

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null,
        "java/lang/Object",
        new String[] { Type.getInternalName(ITarget.class) });

    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);
View Full Code Here

  private byte[] createClass(int version) {

    ClassWriter cw = new ClassWriter(0);
    MethodVisitor mv;

    cw.visit(version, ACC_PUBLIC + ACC_SUPER, "org/jacoco/test/Sample",
        null, "java/lang/Object", null);

    mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
View Full Code Here

    final String className = "org/jacoco/test/targets/RuntimeTestTarget_"
        + classid;
    Type classType = Type.getObjectType(className);

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null,
        "java/lang/Object",
        new String[] { Type.getInternalName(ITarget.class) });

    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);
View Full Code Here

  }

  @Test
  public void testGenerateArgumentArray() throws Exception {
    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Sample", null,
        "java/lang/Object", new String[] { Type
            .getInternalName(Callable.class) });

    // Constructor
    MethodVisitor mv = writer.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
View Full Code Here

  public void testGenerateAccessCall() throws Exception {
    final boolean[] data = store.get(Long.valueOf(1234), "Sample", 5)
        .getData();

    final ClassWriter writer = new ClassWriter(0);
    writer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Sample", null,
        "java/lang/Object", new String[] { Type
            .getInternalName(Callable.class) });

    // Constructor
    MethodVisitor mv = writer.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.