當前位置: 首頁>>代碼示例>>Java>>正文


Java Opcodes.V1_8屬性代碼示例

本文整理匯總了Java中org.objectweb.asm.Opcodes.V1_8屬性的典型用法代碼示例。如果您正苦於以下問題:Java Opcodes.V1_8屬性的具體用法?Java Opcodes.V1_8怎麽用?Java Opcodes.V1_8使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.V1_8屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doVisitMethodInsn

private void doVisitMethodInsn(int opcode, final String owner,
        final String name, final String desc, final boolean itf) {
    checkStartCode();
    checkEndCode();
    checkOpcode(opcode, 5);
    if (opcode != Opcodes.INVOKESPECIAL || !"<init>".equals(name)) {
        checkMethodIdentifier(version, name, "name");
    }
    checkInternalName(owner, "owner");
    checkMethodDesc(desc);
    if (opcode == Opcodes.INVOKEVIRTUAL && itf) {
        throw new IllegalArgumentException(
                "INVOKEVIRTUAL can't be used with interfaces");
    }
    if (opcode == Opcodes.INVOKEINTERFACE && !itf) {
        throw new IllegalArgumentException(
                "INVOKEINTERFACE can't be used with classes");
    }
    if (opcode == Opcodes.INVOKESPECIAL && itf
            && (version & 0xFFFF) < Opcodes.V1_8) {
        throw new IllegalArgumentException(
                "INVOKESPECIAL can't be used with interfaces prior to Java 8");
    }

    // Calling super.visitMethodInsn requires to call the correct version
    // depending on this.api (otherwise infinite loops can occur). To
    // simplify and to make it easier to automatically remove the backward
    // compatibility code, we inline the code of the overridden method here.
    if (mv != null) {
        mv.visitMethodInsn(opcode, owner, name, desc, itf);
    }
    ++insnCount;
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:33,代碼來源:CheckMethodAdapter.java

示例2: visit

@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
{
    if( (version == Opcodes.V1_8 && !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)) ||
        (version == Opcodes.V1_7 && !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)) )
    {
        if(classMap.containsKey(name)) blame(classMap.get(name), name);
        else orphanNaughtyClasses.add(name);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:10,代碼來源:BlamingTransformer.java


注:本文中的org.objectweb.asm.Opcodes.V1_8屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。