mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Replace getDefaultOrNullDefaultCase with getDefaultCase
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user