Example usage for org.objectweb.asm Opcodes ACC_SYNTHETIC

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

Introduction

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

Prototype

int ACC_SYNTHETIC

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

Click Source Link

Usage

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitor.java

License:Apache License

private boolean shouldInclude(int access) {
    if ((access & Opcodes.ACC_PRIVATE) == Opcodes.ACC_PRIVATE) {
        return false;
    }//from  w  w  w . j  a  v  a  2  s  . c o m

    if ((access & (Opcodes.ACC_SYNTHETIC | Opcodes.ACC_BRIDGE)) == Opcodes.ACC_SYNTHETIC) {
        return false;
    }

    return true;
}

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitorTest.java

License:Apache License

@Test
public void testExcludesSyntheticFields() {
    testExcludesFieldWithAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC);
}

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitorTest.java

License:Apache License

@Test
public void testExcludesSyntheticMethods() {
    testExcludesMethodWithAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC);
}

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitorTest.java

License:Apache License

@Test
public void testExcludesSyntheticInnerClasses() {
    visitClass(mockVisitor, "Foo");
    replay(mockVisitor);/* w w  w .jav a  2  s.c om*/

    visitClass(filteringVisitor, "Foo");
    filteringVisitor.visitInnerClass("Foo$Inner", "Foo", "Inner", Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC);
    verify(mockVisitor);
}

From source file:com.facebook.buck.jvm.java.abi.StubJarClassEntry.java

License:Apache License

private static boolean isAnonymousOrLocalOrSyntheticClass(ClassNode node) {
    if ((node.access & Opcodes.ACC_SYNTHETIC) == Opcodes.ACC_SYNTHETIC) {
        return true;
    }/* w ww  .j a  v a  2s  .c  om*/

    InnerClassNode innerClass = getInnerClassMetadata(node);
    while (innerClass != null) {
        if (innerClass.outerName == null) {
            return true;
        }
        innerClass = getInnerClassMetadata(node, innerClass.outerName);
    }

    return false;
}

From source file:com.gargoylesoftware.js.nashorn.internal.ir.debug.NashornTextifier.java

License:Open Source License

private static void appendAccess(final StringBuilder sb, final int access) {
    if ((access & Opcodes.ACC_PUBLIC) != 0) {
        sb.append("public ");
    }/*from w  ww .  j a  v a2s. co  m*/
    if ((access & Opcodes.ACC_PRIVATE) != 0) {
        sb.append("private ");
    }
    if ((access & Opcodes.ACC_PROTECTED) != 0) {
        sb.append("protected ");
    }
    if ((access & Opcodes.ACC_FINAL) != 0) {
        sb.append("final ");
    }
    if ((access & Opcodes.ACC_STATIC) != 0) {
        sb.append("static ");
    }
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
        sb.append("synchronized ");
    }
    if ((access & Opcodes.ACC_VOLATILE) != 0) {
        sb.append("volatile ");
    }
    if ((access & Opcodes.ACC_TRANSIENT) != 0) {
        sb.append("transient ");
    }
    if ((access & Opcodes.ACC_ABSTRACT) != 0) {
        sb.append("abstract ");
    }
    if ((access & Opcodes.ACC_STRICT) != 0) {
        sb.append("strictfp ");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        sb.append("synthetic ");
    }
    if ((access & Opcodes.ACC_MANDATED) != 0) {
        sb.append("mandated ");
    }
    if ((access & Opcodes.ACC_ENUM) != 0) {
        sb.append("enum ");
    }
}

From source file:com.geeksaga.light.profiler.asm.ClassNodeWrapper.java

License:Apache License

@Override
public void visit(final int version, final int access, final String name, final String signature,
        final String superName, final String[] interfaces) {
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        constantPool.newUTF8("Deprecated", isExtend);
    }//ww  w  .j  a  va 2  s . c o m
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        constantPool.newUTF8("Synthetic", isExtend);
    }

    constantPool.newClass(name, isExtend);

    if (signature != null) {
        constantPool.newUTF8("Signature", isExtend);
        constantPool.newUTF8(signature, isExtend);
    }

    if (superName != null) {
        constantPool.newClass(superName, isExtend);
    }

    if (interfaces != null) {
        for (String anInterface : interfaces) {
            constantPool.newClass(anInterface, isExtend);
        }
    }

    super.visit(version, access, name, signature, superName, interfaces);
}

From source file:com.geeksaga.light.profiler.asm.ClassNodeWrapper.java

License:Apache License

@Override
public FieldVisitor visitField(final int access, final String name, final String desc, final String signature,
        final Object value) {
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        constantPool.newUTF8("Synthetic", isExtend);
    }//from w w w .  j a  v a2 s  . co  m
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        constantPool.newUTF8("Deprecated", isExtend);
    }
    constantPool.newUTF8(name, isExtend);
    constantPool.newUTF8(desc, isExtend);

    if (signature != null) {
        constantPool.newUTF8("Signature", isExtend);
        constantPool.newUTF8(signature, isExtend);
    }

    if (value != null) {
        constantPool.newConst(value, isExtend);
    }

    return new FieldConstantsCollector(super.visitField(access, name, desc, signature, value), constantPool);
}

From source file:com.geeksaga.light.profiler.asm.ClassNodeWrapper.java

License:Apache License

@Override
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature,
        final String[] exceptions) {
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        constantPool.newUTF8("Synthetic", isExtend);
    }//from  w  w  w  .ja va 2 s  . c  o  m

    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        constantPool.newUTF8("Deprecated", isExtend);
    }

    constantPool.newUTF8(name, isExtend);
    constantPool.newUTF8(desc, isExtend);

    if (signature != null) {
        constantPool.newUTF8("Signature", isExtend);
        constantPool.newUTF8(signature, isExtend);
    }

    if (exceptions != null) {
        constantPool.newUTF8("Exceptions", isExtend);
        for (String exception : exceptions) {
            constantPool.newClass(exception, isExtend);
        }
    }

    MethodWrapper methodWrapper = new MethodWrapper(
            super.visitMethod(access, name, desc, signature, exceptions), constantPool);
    methodVisitWrappers.add(methodWrapper);

    return methodWrapper;
}

From source file:com.github.jasmo.obfuscate.FullAccessFlags.java

License:Open Source License

private int access(int access) {
    int a = Opcodes.ACC_PUBLIC;
    if ((access & Opcodes.ACC_NATIVE) != 0)
        a |= Opcodes.ACC_NATIVE;// w  ww  .j  a v a 2 s .  c  om
    if ((access & Opcodes.ACC_ABSTRACT) != 0)
        a |= Opcodes.ACC_ABSTRACT;
    if ((access & Opcodes.ACC_ANNOTATION) != 0)
        a |= Opcodes.ACC_ANNOTATION;
    if ((access & Opcodes.ACC_BRIDGE) != 0)
        a |= Opcodes.ACC_BRIDGE;
    //if ((access & Opcodes.ACC_DEPRECATED) != 0) a |= Opcodes.ACC_DEPRECATED;
    if ((access & Opcodes.ACC_ENUM) != 0)
        a |= Opcodes.ACC_ENUM;
    if ((access & Opcodes.ACC_FINAL) != 0)
        a |= Opcodes.ACC_FINAL;
    if ((access & Opcodes.ACC_INTERFACE) != 0)
        a |= Opcodes.ACC_INTERFACE;
    if ((access & Opcodes.ACC_MANDATED) != 0)
        a |= Opcodes.ACC_MANDATED;
    if ((access & Opcodes.ACC_MODULE) != 0)
        a |= Opcodes.ACC_MODULE;
    if ((access & Opcodes.ACC_OPEN) != 0)
        a |= Opcodes.ACC_OPEN;
    if ((access & Opcodes.ACC_STATIC) != 0)
        a |= Opcodes.ACC_STATIC;
    if ((access & Opcodes.ACC_STATIC_PHASE) != 0)
        a |= Opcodes.ACC_STATIC_PHASE;
    if ((access & Opcodes.ACC_STRICT) != 0)
        a |= Opcodes.ACC_STRICT;
    if ((access & Opcodes.ACC_SUPER) != 0)
        a |= Opcodes.ACC_SUPER;
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0)
        a |= Opcodes.ACC_SYNCHRONIZED;
    if ((access & Opcodes.ACC_SYNTHETIC) != 0)
        a |= Opcodes.ACC_SYNTHETIC;
    if ((access & Opcodes.ACC_TRANSIENT) != 0)
        a |= Opcodes.ACC_TRANSIENT;
    if ((access & Opcodes.ACC_TRANSITIVE) != 0)
        a |= Opcodes.ACC_TRANSITIVE;
    if ((access & Opcodes.ACC_VARARGS) != 0)
        a |= Opcodes.ACC_VARARGS;
    if ((access & Opcodes.ACC_VOLATILE) != 0)
        a |= Opcodes.ACC_VOLATILE;
    return a;
}