Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2015-03-14 14:27:10 +0000
committerStephan Herrmann2015-03-15 23:02:11 +0000
commit92a55fb8c61c817a37bdd13d873f8eba50e25d7d (patch)
treed9af70e58c777a08b035a42f8b09e974ae47dda8
parent3478a850278f2be0b18137ec3eb5eeab119a73db (diff)
downloadeclipse.jdt.ui-92a55fb8c61c817a37bdd13d873f8eba50e25d7d.tar.gz
eclipse.jdt.ui-92a55fb8c61c817a37bdd13d873f8eba50e25d7d.tar.xz
eclipse.jdt.ui-92a55fb8c61c817a37bdd13d873f8eba50e25d7d.zip
Bug 461999 - Warning option for bug 410218I20150316-0800
Change-Id: I181a65a3b3d4acc35f159d4da6297b80ce8f08e9 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java6
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties6
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java15
3 files changed, 24 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 62abd83c35..efd8aaed4d 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
*******************************************************************************/
package org.eclipse.jdt.internal.ui.preferences;
@@ -394,6 +396,8 @@ 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_discouraged_invocation_unlikely_argument_type_label;
+ public static String ProblemSeveritiesConfigurationBlock_pb_discouraged_invocation_accept_castable_argument_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 04c9237b58..b5b9a4c8bb 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
###############################################################################
BuildPathsPropertyPage_error_message=An error occurred while setting the build path.
@@ -417,6 +419,8 @@ 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_discouraged_invocation_unlikely_argument_type_label=Unlikely argument type for Map.get() et al
+ProblemSeveritiesConfigurationBlock_pb_discouraged_invocation_accept_castable_argument_label=Accept arguments that could be cast to the expected type
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 811cad15cd..0a2560ab0c 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
@@ -315,6 +315,8 @@ 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_DISCOURAGED_INVOCATION_ACCEPT_CASTABLE_ARGUMENT= getJDTCoreKey(JavaCore.COMPILER_PB_DISCOURAGED_INVOCATION_ACCEPT_CASTABLE_ARGUMENT);
+ private static final Key PREF_15_PB_DISCOURAGED_INVOCATION_UNLIKELY_ARGUMENT_TYPE= getJDTCoreKey(JavaCore.COMPILER_PB_DISCOURAGED_INVOCATION_UNLIKELY_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);
@@ -408,7 +410,8 @@ 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_DISCOURAGED_INVOCATION_UNLIKELY_ARGUMENT_TYPE
};
}
@@ -554,6 +557,12 @@ public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlo
label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_inexact_vararg_label;
fFilteredPrefTree.addComboBox(inner, label, PREF_15_PB_VARARGS_ARGUMENT_NEED_CAST, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent, section);
+ label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_discouraged_invocation_unlikely_argument_type_label;
+ node= fFilteredPrefTree.addComboBox(inner, label, PREF_15_PB_DISCOURAGED_INVOCATION_UNLIKELY_ARGUMENT_TYPE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent, section);
+
+ label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_discouraged_invocation_accept_castable_argument_label;
+ fFilteredPrefTree.addCheckBox(inner, label, PREF_15_PB_DISCOURAGED_INVOCATION_ACCEPT_CASTABLE_ARGUMENT, enabledDisabled, extraIndent, node);
+
// - affecting single statements
label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_empty_statement_label;
fFilteredPrefTree.addComboBox(inner, label, PREF_PB_EMPTY_STATEMENT, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent, section);
@@ -876,6 +885,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_DISCOURAGED_INVOCATION_UNLIKELY_ARGUMENT_TYPE.equals(changedKey) ||
PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey) ||
PREF_PB_SUPPRESS_WARNINGS.equals(changedKey) ||
PREF_ANNOTATION_NULL_ANALYSIS.equals(changedKey)) {
@@ -996,6 +1006,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 enableDiscouragedInvocationAcceptCastable= !checkValue(PREF_15_PB_DISCOURAGED_INVOCATION_UNLIKELY_ARGUMENT_TYPE, IGNORE);
+ getCheckBox(PREF_15_PB_DISCOURAGED_INVOCATION_ACCEPT_CASTABLE_ARGUMENT).setEnabled(enableDiscouragedInvocationAcceptCastable);
+
boolean enableSuppressWarnings= checkValue(PREF_PB_SUPPRESS_WARNINGS, ENABLED);
getCheckBox(PREF_PB_SUPPRESS_OPTIONAL_ERRORS).setEnabled(enableSuppressWarnings);
setComboEnabled(PREF_PB_UNUSED_WARNING_TOKEN, enableSuppressWarnings);

Back to the top