diff --git a/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml b/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml index ed069fa8c587..93ff32ca0703 100644 --- a/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml +++ b/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml @@ -98,6 +98,7 @@ diff --git a/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java b/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java index 8c8ab485435b..706d68fa6dcd 100644 --- a/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection; import com.intellij.codeInspection.LambdaCanBeMethodReferenceInspection.MethodReferenceCandidate; @@ -81,7 +81,7 @@ public class AnonymousCanBeMethodReferenceInspection extends AbstractBaseJavaLoc final TextRange rangeInElement = new TextRange(0, aClass.getStartOffsetInParent() + lBrace.getStartOffsetInParent()); ProblemHighlightType type; if (methodReferenceCandidate.mySafeQualifier && methodReferenceCandidate.myConformsCodeStyle) { - type = ProblemHighlightType.LIKE_UNUSED_SYMBOL; + type = ProblemHighlightType.GENERIC_ERROR_OR_WARNING; } else { if (!isOnTheFly) return; diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java index 13de5cd40b6b..ad02a4e0b057 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java @@ -338,7 +338,7 @@ public final class UnusedDeclarationInspection extends UnusedDeclarationInspecti PsiElement toHighlight = ObjectUtils.notNull(psiVariable.getNameIdentifier(), psiVariable); return myInspectionManager.createProblemDescriptor( toHighlight, JavaBundle.message("inspection.unused.assignment.problem.descriptor1"), (LocalQuickFix)null, - ProblemHighlightType.LIKE_UNUSED_SYMBOL, false); + ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); } } } diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedParametersInspection.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedParametersInspection.java index e53eca02f81e..0fdf97e1dbe5 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedParametersInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedParametersInspection.java @@ -64,7 +64,7 @@ class UnusedParametersInspection extends GlobalJavaBatchInspectionTool { ? "inspection.unused.parameter.composer" : "inspection.unused.parameter.composer1"), new AcceptSuggested(globalContext.getRefManager(), processor, refParameter.getName()), - ProblemHighlightType.LIKE_UNUSED_SYMBOL, false)); + ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)); } } return result.toArray(CommonProblemDescriptor.EMPTY_ARRAY); diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInExpression.java index 0cd57f4074f3..652017771b6e 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInStatement.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInStatement.java index c527f8fb89b8..e8b05c8793df 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInStatement.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterCallInStatement.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { void foo(int n) { String s; diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterConstInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterConstInExpression.java index 3fa486fe32f3..c2b29fd40c89 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterConstInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterConstInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterSwitchExpressionInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterSwitchExpressionInExpression.java index 7033e8b1ae63..f7f443416846 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterSwitchExpressionInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterSwitchExpressionInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { int foo(final int x, int n) { return switch (x) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInExpression.java index 72b890cb7d20..9960f9b01c40 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInStatement.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInStatement.java index d453062d5e13..58eb644c0247 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInStatement.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/afterThrowInStatement.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInExpression.java index 4010a8644b41..cfddf3a9f810 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInStatement.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInStatement.java index 2df03f479191..e9596a547e0f 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInStatement.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeCallInStatement.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { void foo(int n) { String s; diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeConstInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeConstInExpression.java index 428259580d9a..25403abc30ea 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeConstInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeConstInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeSwitchExpressionInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeSwitchExpressionInExpression.java index 716e9d40b9c3..da18dd457f55 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeSwitchExpressionInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeSwitchExpressionInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { int foo(final int x, int n) { return switch (x) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInExpression.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInExpression.java index 3f40027d1ecd..1f52cf3bb637 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInExpression.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInExpression.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { return switch (n) { diff --git a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInStatement.java b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInStatement.java index cc1a2c6cc60c..89e1f6abf00b 100644 --- a/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInStatement.java +++ b/java/java-tests/testData/inspection/redundantLabeledSwitchRuleCodeBlockFix/beforeThrowInStatement.java @@ -1,4 +1,4 @@ -// "Unwrap code block of labeled rule" "LIKE_UNUSED_SYMBOL" +// "Unwrap code block of labeled rule" "GENERIC_ERROR_OR_WARNING" class C { String foo(int n) { switch (n) { diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java index 549d6acebf0d..620ba23aed63 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java @@ -201,9 +201,7 @@ public class InspectionProfileTest extends LightIdeaTestCase { public void testCustomTextAttributes() throws IOException, JDOMException { @Language("XML") String content = "\n" + " "; InspectionProfileImpl profile = createProfile(); readFromXml(profile, content); @@ -727,7 +725,7 @@ public class InspectionProfileTest extends LightIdeaTestCase { }); String mergedText = "\n" + "