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

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

Introduction

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

Prototype

String OPTION_Process_Annotations

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

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  w w  w .j a v  a  2  s.  c om
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
 *//* ww w .j  a v  a 2 s . co 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.
 *//* ww w .j  av  a2s. c o  m*/
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: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   www . j  a v a2 s.com*/
    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.thiesen.ecj4ant.Options.java

License:Open Source License

public static Map<String, String> defaultOptions() {
    return new HashMap<String, String>() {
        private static final long serialVersionUID = 1L;

        {/* w  w w.  j a va 2 s  . c  o m*/
            put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);

            // set the language level to jdk7 (the currently stable version)
            put(CompilerOptions.OPTION_Compliance,
                    CompilerOptions.versionFromJdkLevel(ClassFileConstants.JDK1_7));
            put(CompilerOptions.OPTION_Source, CompilerOptions.versionFromJdkLevel(ClassFileConstants.JDK1_7));
            put(CompilerOptions.OPTION_TargetPlatform,
                    CompilerOptions.versionFromJdkLevel(ClassFileConstants.JDK1_7));
        }

    };
}

From source file:org.thiesen.ecj4ant.Options.java

License:Open Source License

public static Map<String, String> warnAllOptions() {
    return new HashMap<String, String>() {

        private static final long serialVersionUID = 1L;

        {//from  w  ww.ja  va2  s  .  c  o m
            put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);

            put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMethodWithConstructorName, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod,
                    CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference,
                    CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportAssertIdentifier, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnnecessaryElse, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding,
                    CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference,
                    CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
                    CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportFinalParameterBound, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportAutoboxing, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportAnnotationSuperInterface, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportIncompleteEnumSwitch, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportForbiddenReference, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDiscouragedReference, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnhandledWarningToken, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedLabel, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportRedundantSuperinterface, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportComparingIdentical, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportMissingHashCodeMethod, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.WARNING);
        }

    };

}

From source file:org.thiesen.ecj4ant.Options.java

License:Open Source License

public static Map<String, String> saneOptions() {
    return new HashMap<String, String>() {

        private static final long serialVersionUID = 1L;

        {/*from   www.  j  a va 2s.c  om*/
            put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);

            put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMethodWithConstructorName, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod,
                    CompilerOptions.DISABLED);
            put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference,
                    CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportAssertIdentifier, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnnecessaryElse, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding,
                    CompilerOptions.ENABLED);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference,
                    CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
                    CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.WARNING);
            put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportFinalParameterBound, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportAutoboxing, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportAnnotationSuperInterface, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportIncompleteEnumSwitch, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportForbiddenReference, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportDiscouragedReference, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnhandledWarningToken, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportUnusedLabel, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.IGNORE);
            put(CompilerOptions.OPTION_ReportRedundantSuperinterface, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportComparingIdentical, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportMissingHashCodeMethod, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.ERROR);
            put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.ERROR);
        }

    };

}