Use set literals #2

This commit is contained in:
Owen Mansel-Chan
2025-11-28 03:48:50 +00:00
parent 220fd08428
commit 992bd68d4b
3 changed files with 6 additions and 17 deletions

View File

@@ -46,12 +46,7 @@ private class SpecialClassInstanceExpr extends ClassInstanceExpr {
}
predicate throwsNfe() {
this.isStringConstructor("Byte") or
this.isStringConstructor("Short") or
this.isStringConstructor("Integer") or
this.isStringConstructor("Long") or
this.isStringConstructor("Float") or
this.isStringConstructor("Double")
this.isStringConstructor(["Byte", "Short", "Integer", "Long", "Float", "Double"])
}
}

View File

@@ -107,10 +107,7 @@ class XmlAccessType extends EnumConstant {
*/
class JaxbMemberAnnotation extends JaxbAnnotationType {
JaxbMemberAnnotation() {
this.hasName("XmlElement") or
this.hasName("XmlAttribute") or
this.hasName("XmlElementRefs") or
this.hasName("XmlElements")
this.hasName(["XmlElement", "XmlAttribute", "XmlElementRefs", "XmlElements"])
}
}

View File

@@ -187,13 +187,10 @@ class SpringServletInputAnnotation extends Annotation {
a = this.getType() and
a.getPackage().getName() = "org.springframework.web.bind.annotation"
|
a.hasName("MatrixVariable") or
a.hasName("RequestParam") or
a.hasName("RequestHeader") or
a.hasName("CookieValue") or
a.hasName("RequestPart") or
a.hasName("PathVariable") or
a.hasName("RequestBody")
a.hasName([
"MatrixVariable", "RequestParam", "RequestHeader", "CookieValue", "RequestPart",
"PathVariable", "RequestBody"
])
)
}
}