Skip to content

Commit 992bd68

Browse files
committed
Use set literals #2
1 parent 220fd08 commit 992bd68

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

java/ql/lib/semmle/code/java/NumberFormatException.qll

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ private class SpecialClassInstanceExpr extends ClassInstanceExpr {
4646
}
4747

4848
predicate throwsNfe() {
49-
this.isStringConstructor("Byte") or
50-
this.isStringConstructor("Short") or
51-
this.isStringConstructor("Integer") or
52-
this.isStringConstructor("Long") or
53-
this.isStringConstructor("Float") or
54-
this.isStringConstructor("Double")
49+
this.isStringConstructor(["Byte", "Short", "Integer", "Long", "Float", "Double"])
5550
}
5651
}
5752

java/ql/lib/semmle/code/java/frameworks/JAXB.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ class XmlAccessType extends EnumConstant {
107107
*/
108108
class JaxbMemberAnnotation extends JaxbAnnotationType {
109109
JaxbMemberAnnotation() {
110-
this.hasName("XmlElement") or
111-
this.hasName("XmlAttribute") or
112-
this.hasName("XmlElementRefs") or
113-
this.hasName("XmlElements")
110+
this.hasName(["XmlElement", "XmlAttribute", "XmlElementRefs", "XmlElements"])
114111
}
115112
}
116113

java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,10 @@ class SpringServletInputAnnotation extends Annotation {
187187
a = this.getType() and
188188
a.getPackage().getName() = "org.springframework.web.bind.annotation"
189189
|
190-
a.hasName("MatrixVariable") or
191-
a.hasName("RequestParam") or
192-
a.hasName("RequestHeader") or
193-
a.hasName("CookieValue") or
194-
a.hasName("RequestPart") or
195-
a.hasName("PathVariable") or
196-
a.hasName("RequestBody")
190+
a.hasName([
191+
"MatrixVariable", "RequestParam", "RequestHeader", "CookieValue", "RequestPart",
192+
"PathVariable", "RequestBody"
193+
])
197194
)
198195
}
199196
}

0 commit comments

Comments
 (0)