[java-dfa] IDEA-363270 Misleading warning for switch case when expression on Boolean values

(cherry picked from commit 449fdf6cb9137b7dcd038adca7b26ffc15f7d59a)

IJ-CR-150040

GitOrigin-RevId: 957b8f5555a16e1e4912bc19bfe9ff133715709b
This commit is contained in:
Tagir Valeev
2024-11-21 16:30:03 +01:00
committed by intellij-monorepo-bot
parent 3c83acc797
commit b6f684ed23
3 changed files with 16 additions and 0 deletions

View File

@@ -1076,6 +1076,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
addInstruction(new GotoInstruction(endGuardOffset));
((DeferredOffset)targetOffset).setOffset(getInstructionCount());
guard.accept(this);
generateBoxingUnboxingInstructionFor(guard, PsiTypes.booleanType());
addInstruction(new ResultOfInstruction(new JavaSwitchLabelTakenAnchor(guard)));
addInstruction(new ConditionalGotoInstruction(offset, DfTypes.TRUE));
endGuardOffset.setOffset(getInstructionCount());