diff options
author | Stephan Herrmann | 2013-02-02 15:22:13 +0000 |
---|---|---|
committer | Stephan Herrmann | 2013-02-02 15:22:13 +0000 |
commit | 0363ef2a872fe8cfe60ddeaae6b223835db908ea (patch) | |
tree | 7999674561421066232e34c253ae5519e5bb22cb /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl | |
parent | 71aa4260bfba473935abfb2376f189d66c81b8da (diff) | |
download | org.eclipse.objectteams-0363ef2a872fe8cfe60ddeaae6b223835db908ea.tar.gz org.eclipse.objectteams-0363ef2a872fe8cfe60ddeaae6b223835db908ea.tar.xz org.eclipse.objectteams-0363ef2a872fe8cfe60ddeaae6b223835db908ea.zip |
update jdt.core to v20130129-050623 (4.3M5).
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java | 22 | ||||
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java | 7 |
2 files changed, 26 insertions, 3 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java index 67fdcff78..06a761e4e 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java @@ -19,6 +19,8 @@ * bug 366063 - Compiler should not add synthetic @NonNull annotations * bug 374605 - Unreasonable warning for enum-based switch statements * bug 388281 - [compiler][null] inheritance of null annotations as an option + * bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated + * bug 383368 - [compiler][null] syntactic null analysis for field references *******************************************************************************/ package org.eclipse.jdt.internal.compiler.impl; @@ -241,7 +243,9 @@ public class CompilerOptions { static final char[][] DEFAULT_NONNULL_ANNOTATION_NAME = CharOperation.splitOn('.', "org.eclipse.jdt.annotation.NonNull".toCharArray()); //$NON-NLS-1$ static final char[][] DEFAULT_NONNULLBYDEFAULT_ANNOTATION_NAME = CharOperation.splitOn('.', "org.eclipse.jdt.annotation.NonNullByDefault".toCharArray()); //$NON-NLS-1$ public static final String OPTION_ReportMissingNonNullByDefaultAnnotation = "org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation"; //$NON-NLS-1$ + public static final String OPTION_SyntacticNullAnalysisForFields = "org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields"; //$NON-NLS-1$ public static final String OPTION_InheritNullAnnotations = "org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations"; //$NON-NLS-1$ + public static final String OPTION_ReportNonnullParameterAnnotationDropped = "org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped"; //$NON-NLS-1$ /** * Possible values for configurable options */ @@ -355,6 +359,7 @@ public class CompilerOptions { public static final int MissingNonNullByDefaultAnnotation = IrritantSet.GROUP2 | ASTNode.Bit15; public static final int MissingDefaultCase = IrritantSet.GROUP2 | ASTNode.Bit16; public static final int UnusedTypeParameter = IrritantSet.GROUP2 | ASTNode.Bit17; + public static final int NonnullParameterAnnotationDropped = IrritantSet.GROUP2 | ASTNode.Bit18; //{ObjectTeams: OT/J specific problems/irritants: public static final int OTJFlag = IrritantSet.GROUP3; @@ -542,6 +547,9 @@ public class CompilerOptions { /** Should null annotations of overridden methods be inherited? */ public boolean inheritNullAnnotations; + /** Should immediate null-check for fields be considered during null analysis (syntactical match)? */ + public boolean enableSyntacticNullAnalysisForFields; + // keep in sync with warningTokenToIrritant and warningTokenFromIrritant public final static String[] warningTokens = { "all", //$NON-NLS-1$ @@ -819,6 +827,8 @@ public class CompilerOptions { return OPTION_ReportNullUncheckedConversion; case RedundantNullAnnotation : return OPTION_ReportRedundantNullAnnotation; + case NonnullParameterAnnotationDropped: + return OPTION_ReportNonnullParameterAnnotationDropped; } return null; } @@ -1019,8 +1029,10 @@ public class CompilerOptions { OPTION_ReportNullAnnotationInferenceConflict, OPTION_ReportNullUncheckedConversion, OPTION_ReportRedundantNullAnnotation, + OPTION_SyntacticNullAnalysisForFields, OPTION_ReportUnusedTypeParameter, - OPTION_InheritNullAnnotations + OPTION_InheritNullAnnotations, + OPTION_ReportNonnullParameterAnnotationDropped }; return result; } @@ -1090,6 +1102,7 @@ public class CompilerOptions { case NullUncheckedConversion : case RedundantNullAnnotation : case MissingNonNullByDefaultAnnotation: + case NonnullParameterAnnotationDropped: return "null"; //$NON-NLS-1$ case FallthroughCase : return "fallthrough"; //$NON-NLS-1$ @@ -1452,7 +1465,9 @@ public class CompilerOptions { optionsMap.put(OPTION_NonNullByDefaultAnnotationName, String.valueOf(CharOperation.concatWith(this.nonNullByDefaultAnnotationName, '.'))); optionsMap.put(OPTION_ReportMissingNonNullByDefaultAnnotation, getSeverityString(MissingNonNullByDefaultAnnotation)); optionsMap.put(OPTION_ReportUnusedTypeParameter, getSeverityString(UnusedTypeParameter)); + optionsMap.put(OPTION_SyntacticNullAnalysisForFields, this.enableSyntacticNullAnalysisForFields ? ENABLED : DISABLED); optionsMap.put(OPTION_InheritNullAnnotations, this.inheritNullAnnotations ? ENABLED : DISABLED); + optionsMap.put(OPTION_ReportNonnullParameterAnnotationDropped, getSeverityString(NonnullParameterAnnotationDropped)); return optionsMap; } @@ -1611,6 +1626,7 @@ public class CompilerOptions { this.nonNullAnnotationName = DEFAULT_NONNULL_ANNOTATION_NAME; this.nonNullByDefaultAnnotationName = DEFAULT_NONNULLBYDEFAULT_ANNOTATION_NAME; this.intendedDefaultNonNullness = 0; + this.enableSyntacticNullAnalysisForFields = false; this.inheritNullAnnotations = false; this.analyseResourceLeaks = true; @@ -1989,9 +2005,13 @@ public class CompilerOptions { this.nonNullByDefaultAnnotationName = CharOperation.splitAndTrimOn('.', ((String)optionValue).toCharArray()); } if ((optionValue = optionsMap.get(OPTION_ReportMissingNonNullByDefaultAnnotation)) != null) updateSeverity(MissingNonNullByDefaultAnnotation, optionValue); + if ((optionValue = optionsMap.get(OPTION_SyntacticNullAnalysisForFields)) != null) { + this.enableSyntacticNullAnalysisForFields = ENABLED.equals(optionValue); + } if ((optionValue = optionsMap.get(OPTION_InheritNullAnnotations)) != null) { this.inheritNullAnnotations = ENABLED.equals(optionValue); } + if ((optionValue = optionsMap.get(OPTION_ReportNonnullParameterAnnotationDropped)) != null) updateSeverity(NonnullParameterAnnotationDropped, optionValue); } // Javadoc options diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java index 8efc755c8..dba49a4c4 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java @@ -14,6 +14,7 @@ * bug 370639 - [compiler][resource] restore the default for resource leak warnings * bug 265744 - Enum switch should warn about missing default * bug 374605 - Unreasonable warning for enum-based switch statements + * bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated *******************************************************************************/ package org.eclipse.jdt.internal.compiler.impl; @@ -186,7 +187,8 @@ public class IrritantSet { |CompilerOptions.Tasks |CompilerOptions.UnclosedCloseable |CompilerOptions.NullUncheckedConversion - |CompilerOptions.RedundantNullAnnotation); + |CompilerOptions.RedundantNullAnnotation + |CompilerOptions.NonnullParameterAnnotationDropped); // default errors IF AnnotationBasedNullAnalysis is enabled: COMPILER_DEFAULT_ERRORS.set( CompilerOptions.NullSpecViolation @@ -203,7 +205,8 @@ public class IrritantSet { .set(CompilerOptions.NullSpecViolation) .set(CompilerOptions.NullAnnotationInferenceConflict) .set(CompilerOptions.NullUncheckedConversion) - .set(CompilerOptions.RedundantNullAnnotation); + .set(CompilerOptions.RedundantNullAnnotation) + .set(CompilerOptions.NonnullParameterAnnotationDropped); RESTRICTION.set(CompilerOptions.DiscouragedReference); STATIC_ACCESS.set(CompilerOptions.NonStaticAccessToStatic); |