mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java inspection: Improved messages and documentation for the inspection "Lambda parameter type is redundant"
This commit is contained in:
+2
-2
@@ -43,7 +43,7 @@ public class RedundantLambdaParameterTypeInspection extends BaseJavaBatchLocalIn
|
||||
public void visitParameterList(PsiParameterList parameterList) {
|
||||
super.visitParameterList(parameterList);
|
||||
if (isApplicable(parameterList)) {
|
||||
holder.registerProblem(parameterList, "Remove redundant types", new LambdaParametersFix());
|
||||
holder.registerProblem(parameterList, "Lambda parameter type is redundant", new LambdaParametersFix());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -140,7 +140,7 @@ public class RedundantLambdaParameterTypeInspection extends BaseJavaBatchLocalIn
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Remove redundant types";
|
||||
return "Remove redundant parameter types";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
|
||||
public class RedundantLambdaParameterTypeInspectionTest extends LightCodeInsightFixtureTestCase {
|
||||
private RedundantLambdaParameterTypeInspection myInspection = new RedundantLambdaParameterTypeInspection();
|
||||
private String myIntentionName = "Remove redundant types";
|
||||
private String myIntentionName = "Remove redundant parameter types";
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection removes lambda formal parameter types when they can be inferred from context.
|
||||
This inspection reports lambda formal parameter types which are redundant, because they can be inferred from the context.
|
||||
<p>The quick fix removes the parameter types from the lambda.
|
||||
<p>Example: <pre><code>Map<String, Integer> map = ...
|
||||
map.forEach((String s, Integer i) -> log.info(s + "=" + i));</code></pre>
|
||||
<p>The code above can be simplified to the following:
|
||||
<pre><code>Map<String, Integer> map = ...
|
||||
map.forEach((s, i) -> log.info(s + "=" + i));</code></pre>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user