From b9df2dcdc8fd169da0ec9f8330efd456632918eb Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Thu, 21 Mar 2024 12:18:18 +0100 Subject: [PATCH] [java-inspection] IJ-CR-129479 IDEA-349395 InspectionVisitorOptimizer.acceptElements: AssertionError GitOrigin-RevId: 37ba5490b5c39e13cd4bbc797f7d38c4166a1b2f --- .../LimitedScopeInnerClassInspection.java | 3 --- ...LimitedScopeInnerClassInspectionInfoTest.java | 16 ++-------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/java/java-impl/src/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspection.java b/java/java-impl/src/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspection.java index 68c9fae8cf3a..b4f8e0c3b73b 100644 --- a/java/java-impl/src/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspection.java +++ b/java/java-impl/src/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspection.java @@ -62,9 +62,6 @@ public final class LimitedScopeInnerClassInspection extends BaseInspection { if (lBrace != null) { registerErrorAtOffset(aClass, 0, lBrace.getStartOffsetInParent()); } - else { - registerClassError(aClass); - } } } } diff --git a/java/java-tests/testSrc/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspectionInfoTest.java b/java/java-tests/testSrc/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspectionInfoTest.java index 67bff7c12279..45b03c16f86d 100644 --- a/java/java-tests/testSrc/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspectionInfoTest.java +++ b/java/java-tests/testSrc/com/siyeh/ig/classlayout/LimitedScopeInnerClassInspectionInfoTest.java @@ -3,12 +3,10 @@ package com.siyeh.ig.classlayout; import com.intellij.codeHighlighting.HighlightDisplayLevel; import com.intellij.codeInsight.daemon.HighlightDisplayKey; -import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInspection.InspectionProfileEntry; import com.intellij.codeInspection.ex.InspectionProfileImpl; import com.intellij.openapi.project.Project; import com.intellij.profile.codeInspection.ProjectInspectionProfileManager; -import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.LightJavaInspectionTestCase; import org.jetbrains.annotations.Nullable; @@ -19,9 +17,8 @@ public class LimitedScopeInnerClassInspectionInfoTest extends LightJavaInspectio super.setUp(); Project project = getProject(); HighlightDisplayKey displayKey = HighlightDisplayKey.find(getInspection().getShortName()); - InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstance(project).getCurrentProfile(); - HighlightDisplayLevel errorLevel = currentProfile.getErrorLevel(displayKey, null); - currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.DO_NOT_SHOW, project); + InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstance(project).getCurrentProfile(); + currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.DO_NOT_SHOW, project); } public void testUncompletedNestedClass() { @@ -31,15 +28,6 @@ public class LimitedScopeInnerClassInspectionInfoTest extends LightJavaInspectio class Local } }"""); - - final IntentionAction intention = myFixture.getAvailableIntention(InspectionGadgetsBundle.message("move.local.to.inner.quickfix")); - assertEquals(""" - class Example { - void test() { - } - - private static class Local - }""", myFixture.getIntentionPreviewText(intention)); } @Override