Bug 489493: [preferences] UI for new compiler preference from bug 461268

Change-Id: I9ca22ce608c4a8c60ac0bb8d34b114f6c9c84373
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 b8e2605..9fe6783 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
@@ -808,7 +808,8 @@
 	public static String ProblemSeveritiesConfigurationBlock_pb_null_reference;
 	public static String ProblemSeveritiesConfigurationBlock_pb_null_spec_violation;
 	public static String ProblemSeveritiesConfigurationBlock_pb_null_unchecked_conversion;
-	public static String ProblemSeveritiesConfigurationBlock_pb_pessimistic_analysis_for_free_type_variables;	
+	public static String ProblemSeveritiesConfigurationBlock_pb_pessimistic_analysis_for_free_type_variables;
+	public static String ProblemSeveritiesConfigurationBlock_pb_nonnull_typevar_maybe_legacy;
 	public static String ProblemSeveritiesConfigurationBlock_pb_potential_null_reference;
 	public static String ProblemSeveritiesConfigurationBlock_pb_null_annotation_inference_conflict;
 	public static String ProblemSeveritiesConfigurationBlock_pb_potential_resource_leak_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 ed05c66..eb08289 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
@@ -483,6 +483,7 @@
 ProblemSeveritiesConfigurationBlock_pb_null_spec_violation=Violation of null specification:
 ProblemSeveritiesConfigurationBlock_pb_null_unchecked_conversion=Unchecked conversion from non-annotated type to @NonNull type:
 ProblemSeveritiesConfigurationBlock_pb_pessimistic_analysis_for_free_type_variables=Problems detected by pessimistic analysis for free type variables:
+ProblemSeveritiesConfigurationBlock_pb_nonnull_typevar_maybe_legacy=Unsafe '@Nonnull' interpretation of free type variable from library:
 ProblemSeveritiesConfigurationBlock_pb_potential_null_reference=Potential null pointer access:
 ProblemSeveritiesConfigurationBlock_pb_null_annotation_inference_conflict=Conflict between null annotations and null inference:
 ProblemSeveritiesConfigurationBlock_pb_potential_resource_leak_label=Potential resource leak:
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 58b201c..0f94a97 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
@@ -628,6 +628,7 @@
 	private static final Key PREF_PB_POTENTIAL_NULL_ANNOTATION_INFERENCE_CONFLICT= getJDTCoreKey(JavaCore.COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT);
 	private static final Key PREF_PB_NULL_UNCHECKED_CONVERSION= getJDTCoreKey(JavaCore.COMPILER_PB_NULL_UNCHECKED_CONVERSION);
 	private static final Key PREF_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES= getJDTCoreKey(JavaCore.COMPILER_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES);
+	private static final Key PREF_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION= getJDTCoreKey(JavaCore.COMPILER_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION);
 	private static final Key PREF_PB_REDUNDANT_NULL_ANNOTATION= getJDTCoreKey(JavaCore.COMPILER_PB_REDUNDANT_NULL_ANNOTATION);
 	private static final Key PREF_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED= getJDTCoreKey(JavaCore.COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED);
 
@@ -723,6 +724,7 @@
 				PREF_PB_POTENTIAL_NULL_ANNOTATION_INFERENCE_CONFLICT,
 				PREF_PB_NULL_UNCHECKED_CONVERSION,
 				PREF_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES,
+				PREF_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION,
 				PREF_PB_REDUNDANT_NULL_ANNOTATION,
 				PREF_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED,
 				PREF_PB_REDUNDANT_NULL_CHECK, PREF_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS,
@@ -1140,6 +1142,9 @@
 		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_pessimistic_analysis_for_free_type_variables;
 		fFilteredPrefTree.addComboBox(inner, label, PREF_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, extraIndent, node);
 
+		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_nonnull_typevar_maybe_legacy;
+		fFilteredPrefTree.addComboBox(inner, label, PREF_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, extraIndent, node);
+
 		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_redundant_null_annotation;
 		fFilteredPrefTree.addComboBox(inner, label, PREF_PB_REDUNDANT_NULL_ANNOTATION, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, extraIndent, node);
 		
@@ -1354,6 +1359,7 @@
 		setComboEnabled(PREF_PB_POTENTIAL_NULL_ANNOTATION_INFERENCE_CONFLICT, enableAnnotationNullAnalysis);
 		setComboEnabled(PREF_PB_NULL_UNCHECKED_CONVERSION, enableAnnotationNullAnalysis);
 		setComboEnabled(PREF_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES, enableAnnotationNullAnalysis);
+		setComboEnabled(PREF_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION, enableAnnotationNullAnalysis);
 		setComboEnabled(PREF_PB_REDUNDANT_NULL_ANNOTATION, enableAnnotationNullAnalysis);
 		setComboEnabled(PREF_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED, enableAnnotationNullAnalysis);
 		setComboEnabled(PREF_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, enableAnnotationNullAnalysis);