Package org.objectweb.asm

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


        final String closureProxyClassName = p(NativeClosureProxy.class) + "$$impl$$" + nextClassID.getAndIncrement();
        final ClassWriter closureClassWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
        final ClassVisitor closureClassVisitor = DEBUG ? AsmUtil.newCheckClassAdapter(closureClassWriter) : closureClassWriter;
        AsmBuilder builder = new AsmBuilder(closureProxyClassName, closureClassVisitor);

        closureClassVisitor.visit(V1_5, ACC_PUBLIC | ACC_FINAL, closureProxyClassName, null, p(NativeClosureProxy.class),
                new String[]{ });

        Class[] nativeParameterClasses = new Class[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
            nativeParameterClasses[i] = getNativeClass(parameterTypes[i].nativeType);
View Full Code Here


                final String signature,
                final String superName,
                final String[] interfaces)
            {
                owner = name;
                cv.visit(version,
                        access,
                        name,
                        signature,
                        superName,
                        interfaces);
View Full Code Here

    private final static TestClassLoader LOADER = new TestClassLoader();

    public void test() throws Exception {
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        ClassVisitor cv = new StaticInitMerger("$clinit$", cw);
        cv.visit(V1_1, ACC_PUBLIC, "A", null, "java/lang/Object", null);
        cv.visitField(ACC_PUBLIC + ACC_STATIC, "counter", "I", null, null);
        for (int i = 0; i < 5; ++i) {
            MethodVisitor mv = cv.visitMethod(ACC_PUBLIC,
                    "<clinit>",
                    "()V",
View Full Code Here

    }

    public void testIllegalClassAccessFlag() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visit(V1_1, 1 << 20, "C", null, "java/lang/Object", null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    }

    public void testIllegalSuperClass() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visit(V1_1,
                    ACC_PUBLIC,
                    "java/lang/Object",
                    null,
                    "java/lang/Object",
                    null);
View Full Code Here

    }

    public void testIllegalInterfaceSuperClass() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visit(V1_1, ACC_INTERFACE, "I", null, "C", null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    }

    public void testIllegalClassSignature() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visit(V1_1, ACC_PUBLIC, "C", "LC;I", "java/lang/Object", null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    }

    public void testIllegalClassAccessFlagSet() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visit(V1_1,
                    ACC_FINAL + ACC_ABSTRACT,
                    "C",
                    null,
                    "java/lang/Object",
                    null);
View Full Code Here

        }
    }

    public void testIllegalClassAttribute() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        cv.visit(V1_1, ACC_PUBLIC, "C", null, "java/lang/Object", null);
        try {
            cv.visitAttribute(null);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        }
    }

    public void testIllegalMultipleVisitCalls() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        cv.visit(V1_1, ACC_PUBLIC, "C", null, "java/lang/Object", null);
        try {
            cv.visit(V1_1, ACC_PUBLIC, "C", null, "java/lang/Object", null);
            fail();
        } catch (Exception e) {
        }
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.