diff options
| author | Till Brychcy | 2016-10-17 21:50:32 +0000 |
|---|---|---|
| committer | Stephan Herrmann | 2017-03-05 23:44:08 +0000 |
| commit | 3f3a03ae74af438b9ef0dbfb539518bf507ce7cc (patch) | |
| tree | 646e428290ce4231ba174986e9636f4ab8558f6d | |
| parent | 3b6698b8ddb0e1f6566e324d6a8b4e87397a8b97 (diff) | |
| download | eclipse.jdt.ui-3f3a03ae74af438b9ef0dbfb539518bf507ce7cc.tar.gz eclipse.jdt.ui-3f3a03ae74af438b9ef0dbfb539518bf507ce7cc.tar.xz eclipse.jdt.ui-3f3a03ae74af438b9ef0dbfb539518bf507ce7cc.zip | |
Bug 461999 - Warning option for "Unlikely argument type for collection
methods using 'Object'"
Change-Id: I814446c1feff657c80c790c6ac3a10936c06044e
Also-By: Stephan Herrmann <stephan.herrmann@berlin.de>
Signed-off-by: Till Brychcy <register.eclipse@brychcy.de>
3 files changed, 32 insertions, 3 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 45b960249d..deec7d95b5 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,7 +12,9 @@ * 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 + * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for + * [compiler][null] inheritance of null annotations as an option - https://bugs.eclipse.org/388281 + * Warning option for bug 410218 - https://bugs.eclipse.org/461999 * Gábor Kövesdán - Contribution for Bug 350000 - [content assist] Include non-prefix matches in auto-complete suggestions *******************************************************************************/ package org.eclipse.jdt.internal.ui.preferences; @@ -404,6 +406,9 @@ public final class PreferencesMessages extends NLS { public static String ProblemSeveritiesConfigurationBlock_pb_raw_type_reference; public static String ProblemSeveritiesConfigurationBlock_pb_final_param_bound_label; public static String ProblemSeveritiesConfigurationBlock_pb_inexact_vararg_label; + public static String ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_label; + public static String ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_strict_label; + public static String ProblemSeveritiesConfigurationBlock_pb_unlikely_equals_argument_type_label; public static String ProblemSeveritiesConfigurationBlock_pb_accidential_assignement_label; public static String ProblemSeveritiesConfigurationBlock_pb_local_variable_hiding_label; public static String ProblemSeveritiesConfigurationBlock_pb_field_hiding_label; 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 8fb45af172..573e2a35bf 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,7 +12,9 @@ # 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 +# Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for +# [compiler][null] inheritance of null annotations as an option - https://bugs.eclipse.org/388281 +# Warning option for bug 410218 - https://bugs.eclipse.org/461999 # Christian Georgi<christian.georgi@sap.com> - Use OS symbol for 'Ctrl' - https://bugs.eclipse.org/462770 # Gabor Kovesdan - Contribution for Bug 350000 - [content assist] Include non-prefix matches in auto-complete suggestions ############################################################################### @@ -431,6 +433,9 @@ ProblemSeveritiesConfigurationBlock_pb_unsafe_type_op_label=Unchecked generic ty ProblemSeveritiesConfigurationBlock_pb_raw_type_reference=Usage of a raw type: ProblemSeveritiesConfigurationBlock_pb_final_param_bound_label=Generic t&ype parameter declared with a final type bound: ProblemSeveritiesConfigurationBlock_pb_inexact_vararg_label=Inexact type &match for vararg arguments: +ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_label=Unlikely argument type for collection methods using 'Object' +ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_strict_label=Perform strict analysis against the expected type +ProblemSeveritiesConfigurationBlock_pb_unlikely_equals_argument_type_label=Unlikely argument type for method equals() ProblemSeveritiesConfigurationBlock_pb_accidential_assignement_label=Po&ssible accidental boolean assignment (e.g. 'if (a = b)'): ProblemSeveritiesConfigurationBlock_pb_local_variable_hiding_label=Local &variable declaration hides another field or variable: 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 799c4e6f12..0693b62e51 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 @@ -646,6 +646,9 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo private static final Key PREF_15_PB_UNCHECKED_TYPE_OPERATION= getJDTCoreKey(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION); private static final Key PREF_15_PB_FINAL_PARAM_BOUND= getJDTCoreKey(JavaCore.COMPILER_PB_FINAL_PARAMETER_BOUND); private static final Key PREF_15_PB_VARARGS_ARGUMENT_NEED_CAST= getJDTCoreKey(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST); + private static final Key PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE= getJDTCoreKey(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE); + private static final Key PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT= getJDTCoreKey(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT); + private static final Key PREF_15_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE= getJDTCoreKey(JavaCore.COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE); private static final Key PREF_15_PB_AUTOBOXING_PROBLEM= getJDTCoreKey(JavaCore.COMPILER_PB_AUTOBOXING); private static final Key PREF_15_PB_MISSING_OVERRIDE_ANNOTATION= getJDTCoreKey(JavaCore.COMPILER_PB_MISSING_OVERRIDE_ANNOTATION); @@ -745,7 +748,10 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo PREF_PB_UNHANDLED_WARNING_TOKEN, PREF_PB_COMPARING_IDENTICAL, PREF_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD, PREF_PB_MISSING_HASHCODE_METHOD, PREF_PB_DEAD_CODE, PREF_PB_UNUSED_OBJECT_ALLOCATION, - PREF_PB_MISSING_STATIC_ON_METHOD, PREF_PB_POTENTIALLY_MISSING_STATIC_ON_METHOD + PREF_PB_MISSING_STATIC_ON_METHOD, PREF_PB_POTENTIALLY_MISSING_STATIC_ON_METHOD, + PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, + PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT, + PREF_15_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE }; } @@ -892,6 +898,15 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_inexact_vararg_label; fFilteredPrefTree.addComboBox(inner, label, PREF_15_PB_VARARGS_ARGUMENT_NEED_CAST, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); + label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_label; + node= fFilteredPrefTree.addComboBox(inner, label, PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); + + label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unlikely_collection_method_argument_type_strict_label; + fFilteredPrefTree.addCheckBox(inner, label, PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT, enabledDisabled, extraIndent, node); + + label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unlikely_equals_argument_type_label; + fFilteredPrefTree.addComboBox(inner, label, PREF_15_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); + // - affecting single statements label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_empty_statement_label; fFilteredPrefTree.addComboBox(inner, label, PREF_PB_EMPTY_STATEMENT, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); @@ -1223,6 +1238,7 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo PREF_PB_DEPRECATION.equals(changedKey) || PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) || PREF_15_PB_INCOMPLETE_ENUM_SWITCH.equals(changedKey) || + PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE.equals(changedKey) || PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey) || PREF_PB_SUPPRESS_WARNINGS.equals(changedKey) || PREF_ANNOTATION_NULL_ANALYSIS.equals(changedKey)) { @@ -1348,6 +1364,9 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo boolean enableMissingEnumDespiteDefault= !checkValue(PREF_15_PB_INCOMPLETE_ENUM_SWITCH, IGNORE); getCheckBox(PREF_15_PB_MISSING_ENUM_CASE_DESPITE_DEFAULT).setEnabled(enableMissingEnumDespiteDefault); + boolean enableUnlikelyCollectionMethodArgumentTypeStrict= !checkValue(PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, IGNORE); + getCheckBox(PREF_15_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT).setEnabled(enableUnlikelyCollectionMethodArgumentTypeStrict); + boolean enableSuppressWarnings= checkValue(PREF_PB_SUPPRESS_WARNINGS, ENABLED); getCheckBox(PREF_PB_SUPPRESS_OPTIONAL_ERRORS).setEnabled(enableSuppressWarnings); setComboEnabled(PREF_PB_UNUSED_WARNING_TOKEN, enableSuppressWarnings); |
