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

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

Introduction

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

Prototype

String OPTION_IncludeNullInfoFromAsserts

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

Click Source Link

Usage

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(//from   w w w.  ja  v  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;
}