EnumSwitchStatementWhichMissesCasesInspection: isDefaultSwitchLabelStatement fixed (IDEA-CR-40700)

This commit is contained in:
Tagir Valeev
2018-12-03 15:25:57 +07:00
parent ad07f58328
commit d4f85c740a
3 changed files with 3 additions and 1 deletions
@@ -364,7 +364,7 @@ public class EnumSwitchStatementWhichMissesCasesInspection extends AbstractBaseJ
}
private static boolean isDefaultSwitchLabelStatement(PsiElement element) {
return element instanceof PsiSwitchLabelStatement && ((PsiSwitchLabelStatement)element).isDefaultCase();
return element instanceof PsiSwitchLabelStatementBase && ((PsiSwitchLabelStatementBase)element).isDefaultCase();
}
}
@@ -13,6 +13,7 @@ class BeforeDefault {
case C, D -> System.out.println("foo");
case E -> {
}
default -> System.out.println("bar");
}
}
}
@@ -9,6 +9,7 @@ class BeforeDefault {
case A -> System.out.println("foo");
case F -> System.out.println("foo");
case C, D -> System.out.println("foo");
default -> System.out.println("bar");
}
}
}