Example usage for org.objectweb.asm Opcodes V_PREVIEW

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

Introduction

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

Prototype

int V_PREVIEW

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

Click Source Link

Document

Version flag indicating that the class is using 'preview' features.

Usage

From source file:org.codehaus.groovy.classgen.asm.WriterController.java

License:Apache License

private static int chooseBytecodeVersion(final boolean invokedynamic, final boolean previewFeatures,
        final String targetBytecode) {
    Integer bytecodeVersion = CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode);

    if (invokedynamic && bytecodeVersion < Opcodes.V1_8) {
        return Opcodes.V1_8;
    } else {//from  w w  w  .  jav a  2s  . c  om
        if (null != bytecodeVersion) {
            return previewFeatures ? bytecodeVersion | Opcodes.V_PREVIEW : bytecodeVersion;
        }
    }

    throw new GroovyBugError("Bytecode version [" + targetBytecode + "] is not supported by the compiler");
}