当前位置: 首页>>代码示例>>Java>>正文


Java Opcodes.ACC_SYNTHETIC属性代码示例

本文整理汇总了Java中org.objectweb.asm.Opcodes.ACC_SYNTHETIC属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.ACC_SYNTHETIC属性的具体用法?Java Opcodes.ACC_SYNTHETIC怎么用?Java Opcodes.ACC_SYNTHETIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.ACC_SYNTHETIC属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractLocalVariables

@SuppressWarnings(UNCHECKED)
private Set<LocalVariableNode> extractLocalVariables() {
	if ((methodNode.access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_SYNTHETIC)) != 0) {
		return Collections.emptySet();
	}
	final int oneIfThisExists = (methodNode.access & Opcodes.ACC_STATIC) != 0 ? 0 : 1;
	if (methodNode.localVariables.size() <= oneIfThisExists || methodNode.localVariables
			.size() <= Type.getArgumentTypes(methodNode.desc).length + oneIfThisExists) {
		return Collections.emptySet();
	}
	final Set<LocalVariableNode> variables = new LinkedHashSet<>(methodNode.localVariables);
	// on ignore les variables locales "this" et celles des paramètres
	// (attention les variables ne sont pas forcément dans l'ordre des index, en eclipse 3.1 ou 3.2 ?)
	final int nbParameters = Type.getArgumentTypes(methodNode.desc).length + oneIfThisExists;
	for (final Iterator<LocalVariableNode> it = variables.iterator(); it.hasNext();) {
		final int index = it.next().index;
		if (index < nbParameters) {
			it.remove();
		}
	}
	return variables;
}
 
开发者ID:evernat,项目名称:dead-code-detector,代码行数:22,代码来源:LocalVariablesAnalyzer.java

示例2: visit

@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) {
        cp.newUTF8("Deprecated");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        cp.newUTF8("Synthetic");
    }
    cp.newClass(name);
    if (signature != null) {
        cp.newUTF8("Signature");
        cp.newUTF8(signature);
    }
    if (superName != null) {
        cp.newClass(superName);
    }
    if (interfaces != null) {
        for (int i = 0; i < interfaces.length; ++i) {
            cp.newClass(interfaces[i]);
        }
    }
    cv.visit(version, access, name, signature, superName, interfaces);
}
 
开发者ID:acmerli,项目名称:fastAOP,代码行数:25,代码来源:ClassConstantsCollector.java

示例3: visitField

@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) {
        cp.newUTF8("Synthetic");
    }
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        cp.newUTF8("Deprecated");
    }
    cp.newUTF8(name);
    cp.newUTF8(desc);
    if (signature != null) {
        cp.newUTF8("Signature");
        cp.newUTF8(signature);
    }
    if (value != null) {
        cp.newConst(value);
    }
    return new FieldConstantsCollector(cv.visitField(access, name, desc,
            signature, value), cp);
}
 
开发者ID:acmerli,项目名称:fastAOP,代码行数:21,代码来源:ClassConstantsCollector.java

示例4: visitMethod

@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) {
        cp.newUTF8("Synthetic");
    }
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        cp.newUTF8("Deprecated");
    }
    cp.newUTF8(name);
    cp.newUTF8(desc);
    if (signature != null) {
        cp.newUTF8("Signature");
        cp.newUTF8(signature);
    }
    if (exceptions != null) {
        cp.newUTF8("Exceptions");
        for (int i = 0; i < exceptions.length; ++i) {
            cp.newClass(exceptions[i]);
        }
    }
    return new MethodConstantsCollector(cv.visitMethod(access, name, desc,
            signature, exceptions), cp);
}
 
开发者ID:acmerli,项目名称:fastAOP,代码行数:24,代码来源:ClassConstantsCollector.java

示例5: getScore

@Override
public double getScore(FieldInstance fieldA, FieldInstance fieldB, ClassEnvironment env) {
	if (!checkAsmNodes(fieldA, fieldB)) return compareAsmNodes(fieldA, fieldB);

	int mask = (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE) | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT | Opcodes.ACC_SYNTHETIC;
	int resultA = fieldA.getAsmNode().access & mask;
	int resultB = fieldB.getAsmNode().access & mask;

	return 1 - Integer.bitCount(resultA ^ resultB) / 6.;
}
 
开发者ID:sfPlayer1,项目名称:Matcher,代码行数:10,代码来源:FieldClassifier.java

示例6: getScore

@Override
public double getScore(MethodInstance methodA, MethodInstance methodB, ClassEnvironment env) {
	if (!checkAsmNodes(methodA, methodB)) return compareAsmNodes(methodA, methodB);

	int mask = (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE) | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED | Opcodes.ACC_BRIDGE | Opcodes.ACC_VARARGS | Opcodes.ACC_STRICT | Opcodes.ACC_SYNTHETIC;
	int resultA = methodA.getAsmNode().access & mask;
	int resultB = methodB.getAsmNode().access & mask;

	return 1 - Integer.bitCount(resultA ^ resultB) / 8.;
}
 
开发者ID:sfPlayer1,项目名称:Matcher,代码行数:10,代码来源:MethodClassifier.java

示例7: insertClassInit

/**
 * Generates a new clinit.
 * @param className
 * @param target 
 */
private void insertClassInit(String className, ClassNode target) {
    // method void static clinit()
    MethodNode clinit = new MethodNode(Opcodes.ASM5,
        Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC,
        CLASS_INIT_NAME,
        CLASS_INIT_DESC,
        null,
        new String[0]
    );
    
    transformClassInit(className, clinit);
    target.methods.add(clinit);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:NbJShellAgent.java

示例8: write

/** Writes the function to given ClassVisitor. */
void write (ClassVisitor writer, CompilerSettings settings, Globals globals) {
    int access = Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC;
    if (synthetic) {
        access |= Opcodes.ACC_SYNTHETIC;
    }
    final MethodWriter function = new MethodWriter(access, method.method, writer, globals.getStatements(), settings);
    function.visitCode();
    write(function, globals);
    function.endMethod();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:SFunction.java

示例9: appendAccess

static void appendAccess(final int access, final StringBuilder sb) {
    if ((access & Opcodes.ACC_PUBLIC) != 0) {
        sb.append("public ");
    }
    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_SUPER) != 0) {
        if ((access & ACCESS_CLASS) == 0) {
            sb.append("synchronized ");
        } else {
            sb.append("super ");
        }
    }
    if ((access & Opcodes.ACC_VOLATILE) != 0) {
        if ((access & ACCESS_FIELD) == 0) {
            sb.append("bridge ");
        } else {
            sb.append("volatile ");
        }
    }
    if ((access & Opcodes.ACC_TRANSIENT) != 0) {
        if ((access & ACCESS_FIELD) == 0) {
            sb.append("varargs ");
        } else {
            sb.append("transient ");
        }
    }
    if ((access & Opcodes.ACC_NATIVE) != 0) {
        sb.append("native ");
    }
    if ((access & Opcodes.ACC_STRICT) != 0) {
        sb.append("strict ");
    }
    if ((access & Opcodes.ACC_INTERFACE) != 0) {
        sb.append("interface ");
    }
    if ((access & Opcodes.ACC_ABSTRACT) != 0) {
        sb.append("abstract ");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        sb.append("synthetic ");
    }
    if ((access & Opcodes.ACC_ANNOTATION) != 0) {
        sb.append("annotation ");
    }
    if ((access & Opcodes.ACC_ENUM) != 0) {
        sb.append("enum ");
    }
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        sb.append("deprecated ");
    }
    if ((access & Opcodes.ACC_MANDATED) != 0) {
        sb.append("mandated ");
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:65,代码来源:SAXClassAdapter.java

示例10: appendAccess

/**
 * Appends a string representation of the given access modifiers to
 * {@link #buf buf}.
 *
 * @param access
 *            some access modifiers.
 */
private void appendAccess(final int access) {
    if ((access & Opcodes.ACC_PUBLIC) != 0) {
        buf.append("public ");
    }
    if ((access & Opcodes.ACC_PRIVATE) != 0) {
        buf.append("private ");
    }
    if ((access & Opcodes.ACC_PROTECTED) != 0) {
        buf.append("protected ");
    }
    if ((access & Opcodes.ACC_FINAL) != 0) {
        buf.append("final ");
    }
    if ((access & Opcodes.ACC_STATIC) != 0) {
        buf.append("static ");
    }
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
        buf.append("synchronized ");
    }
    if ((access & Opcodes.ACC_VOLATILE) != 0) {
        buf.append("volatile ");
    }
    if ((access & Opcodes.ACC_TRANSIENT) != 0) {
        buf.append("transient ");
    }
    if ((access & Opcodes.ACC_ABSTRACT) != 0) {
        buf.append("abstract ");
    }
    if ((access & Opcodes.ACC_STRICT) != 0) {
        buf.append("strictfp ");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        buf.append("synthetic ");
    }
    if ((access & Opcodes.ACC_MANDATED) != 0) {
        buf.append("mandated ");
    }
    if ((access & Opcodes.ACC_ENUM) != 0) {
        buf.append("enum ");
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:48,代码来源:Textifier.java

示例11: isMethodSyntheticOrBridge

private static boolean isMethodSyntheticOrBridge(int methodAccess){
    return (methodAccess & Opcodes.ACC_SYNTHETIC) > 0
            || (methodAccess & Opcodes.ACC_BRIDGE) > 0 ;
}
 
开发者ID:arcuri82,项目名称:testing_security_development_enterprise_systems,代码行数:4,代码来源:CoverageClassVisitor.java

示例12: isMethodSyntheticOrBridge

public static boolean isMethodSyntheticOrBridge(int methodAccess){
    return (methodAccess & Opcodes.ACC_SYNTHETIC) > 0
            || (methodAccess & Opcodes.ACC_BRIDGE) > 0 ;
}
 
开发者ID:EMResearch,项目名称:EvoMaster,代码行数:4,代码来源:Constants.java


注:本文中的org.objectweb.asm.Opcodes.ACC_SYNTHETIC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。