Example usage for org.eclipse.jdt.internal.compiler.classfmt ClassFileConstants ATTR_SOURCE

List of usage examples for org.eclipse.jdt.internal.compiler.classfmt ClassFileConstants ATTR_SOURCE

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.classfmt ClassFileConstants ATTR_SOURCE.

Prototype

int ATTR_SOURCE

To view the source code for org.eclipse.jdt.internal.compiler.classfmt ClassFileConstants ATTR_SOURCE.

Click Source Link

Usage

From source file:com.google.gwt.dev.javac.JdtCompiler.java

License:Open Source License

public static CompilerOptions getCompilerOptions() {
    CompilerOptions options = new CompilerOptions();
    options.complianceLevel = options.sourceLevel = options.targetJDK = ClassFileConstants.JDK1_6;

    // Generate debug info for debugging the output.
    options.produceDebugAttributes = ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_LINES
            | ClassFileConstants.ATTR_SOURCE;
    // Tricks like "boolean stopHere = true;" depend on this setting.
    options.preserveAllLocalVariables = true;

    // Turn off all warnings, saves some memory / speed.
    options.reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false;
    options.reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false;
    // Instantiations    options.warningThreshold = 0;
    options.inlineJsrBytecode = true;// ww  w  .ja  va2  s .c o m
    return options;
}

From source file:fr.inria.astor.core.manipulation.compiler.bytecode.JDTByteCodeCompiler.java

License:Open Source License

public CompilerOptions getCompilerOption() {
    if (compilerOption == null) {
        compilerOption = new CompilerOptions();
        compilerOption.sourceLevel = ClassFileConstants.JDK1_6;//ClassFileConstants.JDK1_5;
        compilerOption.suppressWarnings = true;

        ///*from  www  .j av  a  2  s  .c  om*/

        compilerOption.targetJDK = ClassFileConstants.JDK1_6; //was 6

        compilerOption.produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES
                | ClassFileConstants.ATTR_VARS;
        compilerOption.preserveAllLocalVariables = true;
        compilerOption.inlineJsrBytecode = true;

        //MM
        compilerOption.tolerateIllegalAmbiguousVarargsInvocation = true;
    }
    return compilerOption;
}