use set literals instead of big disjunctions

This commit is contained in:
Erik Krogh Kristensen
2022-01-20 22:43:00 +01:00
parent 830c2dc90a
commit ddfc3bc00f
10 changed files with 10 additions and 41 deletions

View File

@@ -101,12 +101,7 @@ class Struts2ConventionActionClass extends Class {
exists(string ancestorPackage |
// Has an ancestor package on the whitelist
ancestorPackage = this.getPackage().getName().splitAt(".") and
(
ancestorPackage = "struts" or
ancestorPackage = "struts2" or
ancestorPackage = "action" or
ancestorPackage = "actions"
)
ancestorPackage = ["struts", "struts2", "action", "actions"]
) and
(
this.getName().matches("%" + getConventionSuffix(this)) or

View File

@@ -7,12 +7,7 @@ import semmle.code.java.dataflow.SSA
* The kind of bound that is known to hold for some variable.
*/
library class BoundKind extends string {
BoundKind() {
this = "=" or
this = "!=" or
this = ">=" or
this = "<="
}
BoundKind() { this = ["=", "!=", ">=", "<="] }
predicate isEqual() { this = "=" }