[java-inspections] CreateSwitchBranchesUtil: update labels after shortening

Should fix EA-922716 - IAE: PsiUpdateImpl$ModPsiUpdaterImpl.getRange

GitOrigin-RevId: e034d73b73be8432cc05d82bfca11b1216c46708
This commit is contained in:
Tagir Valeev
2023-11-28 15:14:46 +00:00
committed by intellij-monorepo-bot
parent e1026ad8ae
commit 8c478f8da1
@@ -129,7 +129,7 @@ public final class CreateSwitchBranchesUtil {
addedLabels.add(addSwitchLabelStatementBefore(missingElement, lastChild, switchBlock, isRuleBasedFormat, isPatternsGenerated));
}
}
addedLabels.forEach(label -> javaCodeStyleManager.shortenClassReferences(label));
addedLabels.replaceAll(label -> (PsiSwitchLabelStatementBase)javaCodeStyleManager.shortenClassReferences(label));
return addedLabels;
}