mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't provide potentially unsafe fixes in batch mode (IDEA-167496)
This commit is contained in:
+8
-2
@@ -95,8 +95,14 @@ public class LambdaCanBeMethodReferenceInspection extends BaseJavaBatchLocalInsp
|
||||
? ((PsiNewExpression)methodRefCandidate).getQualifier()
|
||||
: null;
|
||||
boolean safeQualifier = checkQualifier(qualifier);
|
||||
ProblemHighlightType errorOrWarning = safeQualifier ? ProblemHighlightType.GENERIC_ERROR_OR_WARNING
|
||||
: ProblemHighlightType.INFORMATION;
|
||||
ProblemHighlightType errorOrWarning;
|
||||
if (safeQualifier) {
|
||||
errorOrWarning = ProblemHighlightType.GENERIC_ERROR_OR_WARNING;
|
||||
}
|
||||
else {
|
||||
if (!isOnTheFly) return;
|
||||
errorOrWarning = ProblemHighlightType.INFORMATION;
|
||||
}
|
||||
holder.registerProblem(InspectionProjectProfileManager.isInformationLevel(getShortName(), expression) ? expression : candidate,
|
||||
"Can be replaced with method reference",
|
||||
errorOrWarning, new ReplaceWithMethodRefFix(safeQualifier ? "" : " (may change semantics)"));
|
||||
|
||||
Reference in New Issue
Block a user