diff options
| author | Stephan Herrmann | 2012-10-25 17:20:45 +0000 |
|---|---|---|
| committer | Markus Keller | 2012-10-25 18:11:08 +0000 |
| commit | c37f380b5ac6dcf5659e6a49704570892980beb1 (patch) | |
| tree | 240d55fd57e6254d116158484085ab10281fd3be | |
| parent | a12e0828afedc822dc82ce00ab9ae4a0516311f5 (diff) | |
| download | eclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.tar.gz eclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.tar.xz eclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.zip | |
Bug 388281: [compiler][null] inheritance of null annotations as an option
3 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java index 574e0b2045..303e3950ff 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java @@ -12,6 +12,7 @@ * Benjamin Muskalla <b.muskalla@gmx.net> - [preferences] Add preference for new compiler warning: MissingSynchronizedModifierInInheritedMethod - https://bugs.eclipse.org/bugs/show_bug.cgi?id=245240 * Guven Demir <guven.internet+eclipse@gmail.com> - [package explorer] Alternative package name shortening: abbreviation - https://bugs.eclipse.org/bugs/show_bug.cgi?id=299514 * Thomas Reinhardt <thomas@reinhardt.com> - [build path] user library dialog should allow to select JAR from workspace - http://bugs.eclipse.org/300542 + * Stephan Herrmann <stephan@cs.tu-berlin.de> - [compiler][null] inheritance of null annotations as an option - https://bugs.eclipse.org/388281 *******************************************************************************/ package org.eclipse.jdt.internal.ui.preferences; @@ -787,6 +788,7 @@ public final class PreferencesMessages extends NLS { public static String ComplianceConfigurationBlock_src_greater_compliance; public static String ComplianceConfigurationBlock_classfile_greater_compliance; public static String ComplianceConfigurationBlock_classfile_greater_source; + public static String ProblemSeveritiesConfigurationBlock_inherit_null_annotations; public static String ProblemSeveritiesConfigurationBlock_pb_parameter_assignment; public static String ProblemSeveritiesConfigurationBlock_pb_null_reference; public static String ProblemSeveritiesConfigurationBlock_pb_null_spec_violation; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties index 8a83f0cda1..68e6de838d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties @@ -12,6 +12,7 @@ # Benjamin Muskalla <b.muskalla@gmx.net> - [preferences] Add preference for new compiler warning: MissingSynchronizedModifierInInheritedMethod - https://bugs.eclipse.org/bugs/show_bug.cgi?id=245240 # Guven Demir <guven.internet+eclipse@gmail.com> - [package explorer] Alternative package name shortening: abbreviation - https://bugs.eclipse.org/bugs/show_bug.cgi?id=299514 # Thomas Reinhardt <thomas@reinhardt.com> - [build path] user library dialog should allow to select JAR from workspace - http://bugs.eclipse.org/300542 +# Stephan Herrmann <stephan@cs.tu-berlin.de> - [compiler][null] inheritance of null annotations as an option - https://bugs.eclipse.org/388281 ############################################################################### BuildPathsPropertyPage_error_message=An error occurred while setting the build path. @@ -407,6 +408,7 @@ NullAnnotationsConfigurationDialog_null_annotations_description=Enter custom ann NullAnnotationsConfigurationDialog_nullable_annotation_error='Nullable' annotation must be a fully-qualified type name NullAnnotationsConfigurationDialog_nullable_annotation_label='&Nullable' annotation: +ProblemSeveritiesConfigurationBlock_inherit_null_annotations=Inherit null annotations ProblemSeveritiesConfigurationBlock_common_description=&Select the severity level for the following optional problems: ProblemSeveritiesConfigurationBlock_pb_unavoidable_generic_type_problems=Ignore unavoidable generic type problems ProblemSeveritiesConfigurationBlock_pb_unsafe_type_op_label=Unchecked generic type operation: diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java index bd0d3094d9..aed3654caa 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Benjamin Muskalla <b.muskalla@gmx.net> - [preferences] Add preference for new compiler warning: MissingSynchronizedModifierInInheritedMethod - https://bugs.eclipse.org/bugs/show_bug.cgi?id=245240 + * Stephan Herrmann <stephan@cs.tu-berlin.de> - [compiler][null] inheritance of null annotations as an option - https://bugs.eclipse.org/388281 *******************************************************************************/ package org.eclipse.jdt.internal.ui.preferences; @@ -272,6 +273,8 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo private static final Key PREF_ANNOTATION_NULL_ANALYSIS= getJDTCoreKey(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS); + private static final Key PREF_INHERIT_NULL_ANNOTATIONS= getJDTCoreKey(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS); + /** * Key for the "Use default annotations for null " setting. * <p>Values are { {@link #ENABLED}, {@link #DISABLED} }. @@ -382,6 +385,7 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo PREF_PB_NULL_UNCHECKED_CONVERSION, PREF_PB_REDUNDANT_NULL_ANNOTATION, PREF_PB_REDUNDANT_NULL_CHECK, PREF_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS, + PREF_INHERIT_NULL_ANNOTATIONS, PREF_PB_UNCLOSED_CLOSEABLE, PREF_PB_POTENTIALLY_UNCLOSED_CLOSEABLE, PREF_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE, PREF_PB_FALLTHROUGH_CASE, PREF_PB_REDUNDANT_SUPERINTERFACE, PREF_PB_UNUSED_WARNING_TOKEN, PREF_15_PB_UNCHECKED_TYPE_OPERATION, PREF_15_PB_FINAL_PARAM_BOUND, PREF_15_PB_VARARGS_ARGUMENT_NEED_CAST, @@ -800,6 +804,9 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo } }); + label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_inherit_null_annotations; + fFilteredPrefTree.addCheckBox(inner, label, PREF_INHERIT_NULL_ANNOTATIONS, enabledDisabled, extraIndent, node); + // --- global // add some vertical space before: @@ -988,6 +995,7 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo setComboEnabled(PREF_PB_NULL_UNCHECKED_CONVERSION, enableAnnotationNullAnalysis); setComboEnabled(PREF_PB_REDUNDANT_NULL_ANNOTATION, enableAnnotationNullAnalysis); setComboEnabled(PREF_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, enableAnnotationNullAnalysis); + getCheckBox(PREF_INHERIT_NULL_ANNOTATIONS).setEnabled(enableAnnotationNullAnalysis); } private IStatus validateNullnessAnnotation(String value, String errorMessage) { |
