summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-10-25 13:20:45 (EDT)
committer Markus Keller2012-10-25 14:11:08 (EDT)
commitc37f380b5ac6dcf5659e6a49704570892980beb1 (patch)
tree240d55fd57e6254d116158484085ab10281fd3be
parenta12e0828afedc822dc82ce00ab9ae4a0516311f5 (diff)
downloadeclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.zip
eclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.tar.gz
eclipse.jdt.ui-c37f380b5ac6dcf5659e6a49704570892980beb1.tar.bz2
Bug 388281: [compiler][null] inheritance of null annotations as an option
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java2
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties2
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java8
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 574e0b2..303e395 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 8a83f0c..68e6de8 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 bd0d309..aed3654 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) {