Example usage for org.eclipse.jdt.internal.compiler.impl CompilerOptions DISABLED

List of usage examples for org.eclipse.jdt.internal.compiler.impl CompilerOptions DISABLED

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.impl CompilerOptions DISABLED.

Prototype

String DISABLED

To view the source code for org.eclipse.jdt.internal.compiler.impl CompilerOptions DISABLED.

Click Source Link

Usage

From source file:com.codenvy.ide.ext.java.BaseTest.java

License:Open Source License

public BaseTest() {
    options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7);
    options.put(JavaCore.CORE_ENCODING, "UTF-8");
    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7);
    options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_7);
    options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED);
    options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED);
    options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX");
    options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED);
    options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
    options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.DISABLED);
}

From source file:com.google.devtools.j2objc.AnnotationPreProcessor.java

License:Apache License

/**
 * Process the given input files, given in the same format as J2ObjC command line args.
 *///from www.j  a  v a2s .  c o m
void process(Iterable<String> fileArgs) {
    assert tmpDirectory == null; // Shouldn't run an instance more than once.

    if (!hasAnnotationProcessors()) {
        return;
    }

    try {
        tmpDirectory = FileUtil.createTempDir("annotations");
    } catch (IOException e) {
        ErrorUtil.error("failed creating temporary directory: " + e);
        return;
    }
    String tmpDirPath = tmpDirectory.getAbsolutePath();
    List<String> compileArgs = Lists.newArrayList();
    Joiner pathJoiner = Joiner.on(":");
    List<String> sourcePath = Options.getSourcePathEntries();
    sourcePath.add(tmpDirPath);
    compileArgs.add("-sourcepath");
    compileArgs.add(pathJoiner.join(sourcePath));
    compileArgs.add("-classpath");
    List<String> classPath = Options.getClassPathEntries();
    compileArgs.add(pathJoiner.join(classPath));
    compileArgs.add("-encoding");
    compileArgs.add(Options.getCharset().name());
    compileArgs.add("-source");
    compileArgs.add("1.7");
    compileArgs.add("-s");
    compileArgs.add(tmpDirPath);
    compileArgs.add("-d");
    compileArgs.add(tmpDirPath);
    if (Options.isVerbose()) {
        compileArgs.add("-XprintProcessorInfo");
        compileArgs.add("-XprintRounds");
    }
    for (String fileArg : fileArgs) {
        compileArgs.add(fileArg);
    }
    Map<String, String> batchOptions = Maps.newHashMap();
    batchOptions.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
    batchOptions.put(CompilerOptions.OPTION_GenerateClassFiles, CompilerOptions.DISABLED);
    // Fully qualified name used since "Main" isn't unique.
    org.eclipse.jdt.internal.compiler.batch.Main batchCompiler = new org.eclipse.jdt.internal.compiler.batch.Main(
            new PrintWriter(System.out), new PrintWriter(System.err), false, batchOptions, null);
    if (!batchCompiler.compile(compileArgs.toArray(new String[0]))) {
        // Any compilation errors will already by displayed.
        ErrorUtil.error("failed batch processing sources");
    } else {
        addGeneratedSources(tmpDirectory, "");
    }
}

From source file:com.google.devtools.j2objc.jdt.AnnotationPreProcessor.java

License:Apache License

/**
 * Process the given input files, given in the same format as J2ObjC command line args.
 *
 * @return the list of processor-generated sources
 *//*from w ww .  j ava2s  .c o  m*/
public List<ProcessingContext> process(Iterable<String> fileArgs, List<ProcessingContext> inputs) {
    assert tmpDirectory == null; // Shouldn't run an instance more than once.

    if (!hasAnnotationProcessors()) {
        return generatedInputs;
    }

    try {
        tmpDirectory = FileUtil.createTempDir("annotations");
    } catch (IOException e) {
        ErrorUtil.error("failed creating temporary directory: " + e);
        return generatedInputs;
    }
    String tmpDirPath = tmpDirectory.getAbsolutePath();
    List<String> compileArgs = Lists.newArrayList();
    Joiner pathJoiner = Joiner.on(":");
    List<String> sourcePath = options.fileUtil().getSourcePathEntries();
    sourcePath.add(tmpDirPath);
    compileArgs.add("-sourcepath");
    compileArgs.add(pathJoiner.join(sourcePath));
    compileArgs.add("-classpath");
    List<String> classPath = options.fileUtil().getClassPathEntries();
    compileArgs.add(pathJoiner.join(classPath));
    compileArgs.add("-encoding");
    compileArgs.add(options.fileUtil().getCharset().name());
    compileArgs.add("-source");
    compileArgs.add(options.getSourceVersion().flag());
    compileArgs.add("-s");
    compileArgs.add(tmpDirPath);
    compileArgs.add("-d");
    compileArgs.add(tmpDirPath);
    List<String> processorPath = options.getProcessorPathEntries();
    if (!processorPath.isEmpty()) {
        compileArgs.add("-processorpath");
        compileArgs.add(pathJoiner.join(processorPath));
    }
    String processorClasses = options.getProcessors();
    if (processorClasses != null) {
        compileArgs.add("-processor");
        compileArgs.add(processorClasses);
    }
    if (options.isVerbose()) {
        compileArgs.add("-XprintProcessorInfo");
        compileArgs.add("-XprintRounds");
    }
    for (String fileArg : fileArgs) {
        compileArgs.add(fileArg);
    }
    Map<String, String> batchOptions = Maps.newHashMap();
    batchOptions.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
    batchOptions.put(CompilerOptions.OPTION_GenerateClassFiles, CompilerOptions.DISABLED);
    AnnotationCompiler batchCompiler = new AnnotationCompiler(compileArgs, batchOptions,
            new PrintWriter(System.out), new PrintWriter(System.err), inputs, options);
    if (!batchCompiler.compile(compileArgs.toArray(new String[0]))) {
        // Any compilation errors will already by displayed.
        ErrorUtil.error("failed batch processing sources");
    }
    if (!options.getHeaderMap().includeGeneratedSources() && tmpDirectory != null) {
        collectGeneratedInputs(tmpDirectory, "", inputs);
    }
    return generatedInputs;
}

From source file:com.google.devtools.j2objc.pipeline.AnnotationPreProcessor.java

License:Apache License

/**
 * Process the given input files, given in the same format as J2ObjC command line args.
 *//*from w  w w .  ja  v  a  2s .c  om*/
public void process(Iterable<String> fileArgs) {
    assert tmpDirectory == null; // Shouldn't run an instance more than once.

    if (!hasAnnotationProcessors()) {
        return;
    }

    try {
        tmpDirectory = FileUtil.createTempDir("annotations");
    } catch (IOException e) {
        ErrorUtil.error("failed creating temporary directory: " + e);
        return;
    }
    String tmpDirPath = tmpDirectory.getAbsolutePath();
    List<String> compileArgs = Lists.newArrayList();
    Joiner pathJoiner = Joiner.on(":");
    List<String> sourcePath = Options.getSourcePathEntries();
    sourcePath.add(tmpDirPath);
    compileArgs.add("-sourcepath");
    compileArgs.add(pathJoiner.join(sourcePath));
    compileArgs.add("-classpath");
    List<String> classPath = Options.getClassPathEntries();
    compileArgs.add(pathJoiner.join(classPath));
    compileArgs.add("-encoding");
    compileArgs.add(Options.getCharset().name());
    compileArgs.add("-source");
    compileArgs.add(Options.getSourceVersion());
    compileArgs.add("-s");
    compileArgs.add(tmpDirPath);
    compileArgs.add("-d");
    compileArgs.add(tmpDirPath);
    List<String> processorPath = Options.getProcessorPathEntries();
    if (!processorPath.isEmpty()) {
        compileArgs.add("-processorpath");
        compileArgs.add(pathJoiner.join(processorPath));
    }
    String processorClasses = Options.getProcessors();
    if (processorClasses != null) {
        compileArgs.add("-processor");
        compileArgs.add(processorClasses);
    }
    if (Options.isVerbose()) {
        compileArgs.add("-XprintProcessorInfo");
        compileArgs.add("-XprintRounds");
    }
    for (String fileArg : fileArgs) {
        compileArgs.add(fileArg);
    }
    Map<String, String> batchOptions = Maps.newHashMap();
    batchOptions.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
    batchOptions.put(CompilerOptions.OPTION_GenerateClassFiles, CompilerOptions.DISABLED);
    // Fully qualified name used since "Main" isn't unique.
    org.eclipse.jdt.internal.compiler.batch.Main batchCompiler = new org.eclipse.jdt.internal.compiler.batch.Main(
            new PrintWriter(System.out), new PrintWriter(System.err), false, batchOptions, null);
    if (!batchCompiler.compile(compileArgs.toArray(new String[0]))) {
        // Any compilation errors will already by displayed.
        ErrorUtil.error("failed batch processing sources");
    }
}

From source file:dacapo.eclipse.EclipseBuildTests.java

License:Open Source License

protected static Hashtable warningOptions(int kind) {
    // Values/*from   w  w  w .  j a v  a2 s. c  om*/
    Hashtable optionsMap = null;
    switch (kind) {
    case 0:
        optionsMap = JavaCore.getDefaultOptions();
        break;
    default:
        optionsMap = new Hashtable(350);
        break;
    }
    if (kind == 0) {
        // Default set since 3.1
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE);
    } else {
        boolean all = kind == 1;
        String generate = all ? CompilerOptions.GENERATE : CompilerOptions.DO_NOT_GENERATE;
        String warning = all ? CompilerOptions.WARNING : CompilerOptions.IGNORE;
        String enabled = all ? CompilerOptions.ENABLED : CompilerOptions.DISABLED;
        String preserve = all ? CompilerOptions.OPTIMIZE_OUT : CompilerOptions.PRESERVE;

        // Set options values
        optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, generate);
        optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, generate);
        optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, generate);
        optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, preserve);
        optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryElse, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, warning);
        optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, warning);
        optionsMap.put(CompilerOptions.OPTION_TaskTags, all ? JavaCore.DEFAULT_TASK_TAGS : "");
        optionsMap.put(CompilerOptions.OPTION_TaskPriorities, all ? JavaCore.DEFAULT_TASK_PRIORITIES : "");
        optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, enabled);
        optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, enabled);
        optionsMap.put(CompilerOptions.OPTION_InlineJsr, enabled);
    }

    // Ignore 3.1 options
    optionsMap.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
    optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE);

    // Return created options map
    return optionsMap;
}

From source file:org.ant4eclipse.ant.jdt.ecj.CompilerOptionsProvider.java

License:Open Source License

/**
 * <p>//from   w w w.ja va 2 s  . co m
 * Returns the compiler options specified in the javac task.
 * </p>
 * 
 * @param javac
 *          the javac task
 * @return the compiler options specified in the javac task.
 */
@SuppressWarnings("unchecked")
private static final StringMap getJavacCompilerOptions(Javac javac) {

    StringMap result = new StringMap();

    /*
     * set the source option
     */
    if (Utilities.hasText(javac.getSource())) {

        // get the source
        String source = javac.getSource();
        // set the source
        if (source.equals("1.3")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
        } else if (source.equals("1.4")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
        } else if (source.equals("1.5") || source.equals("5") || source.equals("5.0")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
        } else if (source.equals("1.6") || source.equals("6") || source.equals("6.0")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
        } else if (source.equals("1.7") || source.equals("7") || source.equals("7.0")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
        } else if (source.equals("1.8") || source.equals("8") || source.equals("8.0")) {
            result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
        } else {
            throw new Ant4EclipseException(EcjExceptionCodes.UNKNOWN_JAVA_SOURCE_OPTION_EXCEPTION, source);
        }
    }

    /*
     * set the target option
     */
    if (Utilities.hasText(javac.getTarget())) {

        // get the target
        String target = javac.getTarget();

        // set the target
        if (target.equals("1.3")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_3);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_3);
        } else if (target.equals("1.4")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
        } else if (target.equals("1.5") || target.equals("5") || target.equals("5.0")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
        } else if (target.equals("1.6") || target.equals("6") || target.equals("6.0")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
        } else if (target.equals("1.7") || target.equals("7") || target.equals("7.0")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
        } else if (target.equals("1.8") || target.equals("8") || target.equals("8.0")) {
            result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
            result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
        } else {
            throw new Ant4EclipseException(EcjExceptionCodes.UNKNOWN_JAVA_TARGET_OPTION_EXCEPTION, target);
        }
    }

    /*
     * set the debug options
     */
    if (javac.getDebug()) {

        String debugLevel = javac.getDebugLevel();

        if (debugLevel != null) {
            result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
            result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE);
            result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE);
            if (debugLevel.length() != 0) {
                if (debugLevel.indexOf("vars") != -1) {
                    result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
                }
                if (debugLevel.indexOf("lines") != -1) {
                    result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
                }
                if (debugLevel.indexOf("source") != -1) {
                    result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
                }
            }
        } else {
            result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
            result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
            result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
        }
    } else {
        result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
        result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE);
        result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE);
    }

    /*
     * Handle the nowarn option. If none, then we generate all warnings.
     */
    if (javac.getNowarn()) {
        // disable all warnings
        Map.Entry<String, String>[] entries = result.entrySet().toArray(new Map.Entry[result.size()]);
        for (Entry<String, String> entrie : entries) {
            Map.Entry<String, String> entry = entrie;
            if (entry.getValue().equals(CompilerOptions.WARNING)) {
                result.put(entry.getKey(), CompilerOptions.IGNORE);
            }
        }
        result.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING);
        if (javac.getDeprecation()) {
            result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
            result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
            result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod,
                    CompilerOptions.ENABLED);
        }
    } else if (javac.getDeprecation()) {
        result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
        result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
        result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod,
                CompilerOptions.ENABLED);
    } else {
        result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE);
        result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED);
        result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod,
                CompilerOptions.DISABLED);
    }

    /*
     * set the encoding option
     */
    if (javac.getEncoding() != null) {
        result.put(CompilerOptions.OPTION_Encoding, javac.getEncoding());
    }

    // return result
    return result;
}

From source file:org.ebayopensource.dsf.javatojs.util.AstParserHelper.java

License:Open Source License

/**
 * create AND CONFIGURE an AST Parser using Java5 compliance levels...
 *//*from   ww w.ja va 2s . com*/
public static ASTParser newParser(boolean parseComments) {
    // Enable/disable JavaDoc parsing
    COMPILER_OPTION.put(CompilerOptions.OPTION_DocCommentSupport,
            parseComments ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
    // Create the AST: AST.JLS3 handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5
    ASTParser astParser = ASTParser.newParser(AST.JLS3);
    astParser.setCompilerOptions(COMPILER_OPTION);
    astParser.setKind(ASTParser.K_COMPILATION_UNIT);
    return astParser;
}

From source file:org.ecipse.che.plugin.testing.testng.server.BaseTest.java

License:Open Source License

public BaseTest() {
    options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
    options.put(JavaCore.CORE_ENCODING, "UTF-8");
    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
    options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_8);
    options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED);
    options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED);
    options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX");
    options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED);
    options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
    options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.DISABLED);
}

From source file:org.eclipse.che.jdt.JavaProjectService.java

License:Open Source License

@Inject
public JavaProjectService(EventService eventService, LocalFSMountStrategy fsMountStrategy,
        @Named("che.java.codeassistant.index.dir") String temp) {
    eventService.subscribe(new VirtualFileEventSubscriber());
    this.fsMountStrategy = fsMountStrategy;
    tempDir = temp;//from w  w w . j  a v a 2s . co  m
    options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7);
    options.put(JavaCore.CORE_ENCODING, "UTF-8");
    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7);
    options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_7);
    options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED);
    options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
    options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED);
    options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX");
    options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED);
    options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
    options.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
    options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.ENABLED);
    options.put(CompilerOptions.OPTION_GenerateClassFiles, JavaCore.ENABLED);
    cache = CacheBuilder.newBuilder().expireAfterAccess(4, TimeUnit.HOURS)
            .removalListener(new RemovalListener<String, JavaProject>() {
                @Override
                public void onRemoval(RemovalNotification<String, JavaProject> notification) {
                    JavaProject value = notification.getValue();
                    if (value != null) {
                        closeProject(value);
                        deleteDependencyDirectory(value.getWsId(), value.getProjectPath());
                    }
                }
            }).build();
}

From source file:org.eclipse.objectteams.jdt.nullity.tests.NullAnnotationTest.java

License:Open Source License

protected Map getCompilerOptions() {
    Map defaultOptions = super.getCompilerOptions();
    if (setNullRelatedOptions) {
        defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
        defaultOptions.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
        defaultOptions.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
        defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
        defaultOptions.put(CompilerOptions.OPTION_IncludeNullInfoFromAsserts, CompilerOptions.ENABLED);

        defaultOptions.put(//  ww w. jav  a  2 s.  c  o  m
                CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation,
                CompilerOptions.DISABLED);

        // enable null annotations:
        defaultOptions.put(NullCompilerOptions.OPTION_AnnotationBasedNullAnalysis, CompilerOptions.ENABLED);
        // leave other new options at these defaults:
        //      defaultOptions.put(CompilerOptions.OPTION_ReportNullSpecViolation, CompilerOptions.ERROR);
        //      defaultOptions.put(CompilerOptions.OPTION_ReportPotentialNullSpecViolation, CompilerOptions.ERROR);
        //      defaultOptions.put(CompilerOptions.OPTION_ReportNullSpecInsufficientInfo, CompilerOptions.WARNING);
        //      defaultOptions.put(CompilerOptions.OPTION_ReportRedundantNullAnnotation, CompilerOptions.WARNING);

        //      defaultOptions.put(CompilerOptions.OPTION_NullableAnnotationName, "org.eclipse.jdt.annotation.Nullable");
        //      defaultOptions.put(CompilerOptions.OPTION_NonNullAnnotationName, "org.eclipse.jdt.annotation.NonNull");
    }
    return defaultOptions;
}