Skip to content

Commit 44f42de

Browse files
committed
New UI option to configure problem severity for unused lambda parameters
Fixes #1721
1 parent b8fb344 commit 44f42de

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ private PreferencesMessages() {
469469
public static String ProblemSeveritiesConfigurationBlock_pb_static_access_receiver_label;
470470
public static String ProblemSeveritiesConfigurationBlock_pb_unused_imports_label;
471471
public static String ProblemSeveritiesConfigurationBlock_pb_unused_local_label;
472+
public static String ProblemSeveritiesConfigurationBlock_pb_unused_lambda_parameter_label;
472473
public static String ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label;
473474
public static String ProblemSeveritiesConfigurationBlock_pb_unused_exception_parameter_label;
474475
public static String ProblemSeveritiesConfigurationBlock_pb_unused_type_parameter;

org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ ProblemSeveritiesConfigurationBlock_pb_hidden_catchblock_label=Hidden catch bloc
492492
ProblemSeveritiesConfigurationBlock_pb_static_access_receiver_label=Non-static access to static member:
493493
ProblemSeveritiesConfigurationBlock_pb_unused_imports_label=Unused &import:
494494
ProblemSeveritiesConfigurationBlock_pb_unused_local_label=&Value of local variable is not used:
495+
ProblemSeveritiesConfigurationBlock_pb_unused_lambda_parameter_label=&Value of lambda parameter is not used (22 or higher):
495496
ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label=Value of method parameter is not used:
496497
ProblemSeveritiesConfigurationBlock_pb_unused_exception_parameter_label=Value of exception parameter is not used:
497498
ProblemSeveritiesConfigurationBlock_pb_unused_type_parameter=Unused type parameter:

org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ public String[] getResult() {
682682

683683
private static final Key PREF_PB_HIDDEN_CATCH_BLOCK= getJDTCoreKey(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK);
684684
private static final Key PREF_PB_UNUSED_LOCAL= getJDTCoreKey(JavaCore.COMPILER_PB_UNUSED_LOCAL);
685+
private static final Key PREF_PB_UNUSED_LAMBDA_PARAMETER= getJDTCoreKey(JavaCore.COMPILER_PB_UNUSED_LAMBDA_PARAMETER);
685686
private static final Key PREF_PB_UNUSED_PARAMETER= getJDTCoreKey(JavaCore.COMPILER_PB_UNUSED_PARAMETER);
686687
private static final Key PREF_PB_UNUSED_EXCEPTION_PARAMETER= getJDTCoreKey(JavaCore.COMPILER_PB_UNUSED_EXCEPTION_PARAMETER);
687688
private static final Key PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING= getJDTCoreKey(JavaCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_OVERRIDING_CONCRETE);
@@ -842,6 +843,7 @@ public static Key[] getKeys() {
842843
return new Key[] {
843844
PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD,
844845
PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, PREF_PB_DEPRECATION, PREF_PB_TERMINAL_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
846+
PREF_PB_UNUSED_LAMBDA_PARAMETER,
845847
PREF_PB_API_LEAKS,
846848
PREF_PB_UNSTABLE_AUTO_MODULE_NAME,
847849
PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_EXCEPTION_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE,
@@ -1201,6 +1203,9 @@ public void widgetSelected(SelectionEvent e) {
12011203
label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_local_label;
12021204
fFilteredPrefTree.addComboBox(inner, label, PREF_PB_UNUSED_LOCAL, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section);
12031205

1206+
label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_lambda_parameter_label;
1207+
fFilteredPrefTree.addComboBox(inner, label, PREF_PB_UNUSED_LAMBDA_PARAMETER, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section);
1208+
12041209
label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label;
12051210
node= fFilteredPrefTree.addComboBox(inner, label, PREF_PB_UNUSED_PARAMETER, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section);
12061211

0 commit comments

Comments
 (0)