Skip to content

Commit a629974

Browse files
committed
Remove unused imports; use set literals in hasName
1 parent ed56194 commit a629974

File tree

2 files changed

+2
-7
lines changed
  • java/ql
    • src/semmle/code/java/security
    • test/experimental/query-tests/security/CWE-643

2 files changed

+2
-7
lines changed

java/ql/src/semmle/code/java/security/XPath.qll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import semmle.code.java.dataflow.FlowSources
22
import semmle.code.java.dataflow.TaintTracking
3-
import semmle.code.java.security.XmlParsers
43

54
/**
65
* An abstract type representing a call to interpret XPath expressions.
@@ -18,9 +17,7 @@ class XPath extends RefType {
1817
class XPathEvaluateOrCompile extends XPathSink {
1918
XPathEvaluateOrCompile() {
2019
exists(Method m | this.getMethod() = m and m.getDeclaringType() instanceof XPath |
21-
m.hasName("evaluate")
22-
or
23-
m.hasName("compile")
20+
m.hasName(["evaluate", "compile"])
2421
)
2522
}
2623

@@ -36,7 +33,7 @@ class Dom4JNode extends RefType {
3633
class NodeSelectNodes extends XPathSink {
3734
NodeSelectNodes() {
3835
exists(Method m | this.getMethod() = m and m.getDeclaringType() instanceof Dom4JNode |
39-
m.hasName("selectNodes") or m.hasName("selectSingleNode")
36+
m.hasName(["selectNodes", "selectSingleNode"])
4037
)
4138
}
4239

java/ql/test/experimental/query-tests/security/CWE-643/A.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import javax.xml.*;
2-
31
import org.w3c.dom.Document;
42
import org.xml.sax.InputSource;
53
import org.xml.sax.SAXException;

0 commit comments

Comments
 (0)