Java Code Examples for jdk.internal.org.objectweb.asm.Opcodes#ACC_STATIC_PHASE

The following examples show how to use jdk.internal.org.objectweb.asm.Opcodes#ACC_STATIC_PHASE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Textifier.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
@Override
public void visitRequire(final String require, final int access, final String version) {
    stringBuilder.setLength(0);
    stringBuilder.append(tab).append("requires ");
    if ((access & Opcodes.ACC_TRANSITIVE) != 0) {
        stringBuilder.append("transitive ");
    }
    if ((access & Opcodes.ACC_STATIC_PHASE) != 0) {
        stringBuilder.append("static ");
    }
    stringBuilder.append(require).append(';');
    appendRawAccess(access);
    if (version != null) {
        stringBuilder.append("  // version ").append(version).append('\n');
    }
    text.add(stringBuilder.toString());
}
 
Example 2
Source File: CheckModuleAdapter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
@Override
public void visitRequire(final String module, final int access, final String version) {
    checkVisitEndNotCalled();
    CheckClassAdapter.checkFullyQualifiedName(Opcodes.V9, module, "required module");
    requiredModules.checkNameNotAlreadyDeclared(module);
    CheckClassAdapter.checkAccess(
            access,
            Opcodes.ACC_STATIC_PHASE
                    | Opcodes.ACC_TRANSITIVE
                    | Opcodes.ACC_SYNTHETIC
                    | Opcodes.ACC_MANDATED);
    if (classVersion >= Opcodes.V10
            && module.equals("java.base")
            && (access & (Opcodes.ACC_STATIC_PHASE | Opcodes.ACC_TRANSITIVE)) != 0) {
        throw new IllegalArgumentException(
                "Invalid access flags: "
                        + access
                        + " java.base can not be declared ACC_TRANSITIVE or ACC_STATIC_PHASE");
    }
    super.visitRequire(module, access, version);
}