Replace getDefaultOrNullDefaultCase with getDefaultCase

This commit is contained in:
Chris Smowton
2023-11-16 14:23:56 +00:00
parent 0bb051e08c
commit d2ff1baff0
7 changed files with 17 additions and 15 deletions

View File

@@ -15,5 +15,5 @@ import java
from SwitchStmt switch
where
not switch.getExpr().getType() instanceof EnumType and
not exists(switch.getDefaultOrNullDefaultCase())
not exists(switch.getDefaultCase())
select switch, "Switch statement does not have a default case."

View File

@@ -17,6 +17,6 @@ from SwitchStmt switch, EnumType enum, EnumConstant missing
where
switch.getExpr().getType() = enum and
missing.getDeclaringType() = enum and
not exists(switch.getDefaultOrNullDefaultCase()) and
not exists(switch.getDefaultCase()) and
not switch.getAConstCase().getValue() = missing.getAnAccess()
select switch, "Switch statement does not have a case for $@.", missing, missing.getName()