[java-inspections] EA-1288620 record deconstruction can be broken in inspections

- check that record deconstructions have correct numbers of components
- optimize `unwrapSealedTypes` a bit

GitOrigin-RevId: 167dabb1a5e6dd156e8d5772373c6f059e209257
This commit is contained in:
Mikhail Pyltsin
2024-06-20 12:45:41 +02:00
committed by intellij-monorepo-bot
parent de3c5578e4
commit fc86f137ca
5 changed files with 165 additions and 21 deletions

View File

@@ -113,6 +113,10 @@ public class LightPatternsHighlightingTest extends LightJavaCodeInsightFixtureTe
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_22, this::doTest);
}
public void testBrokenRecordNumber() {
IdeaTestUtil.withLevel(getModule(), LanguageLevel.JDK_22, this::doTest);
}
private void doTest() {
myFixture.configureByFile(getTestName(false) + ".java");
myFixture.checkHighlighting();

View File

@@ -20,7 +20,11 @@ public class SwitchStatementsWithoutDefaultInspectionTest extends LightJavaInspe
myInspection.m_ignoreFullyCoveredEnums = false;
doTest();
}
public void testBrokenRecords() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {