Skip to content

Commit efec348

Browse files
committed
Java: use AccessPathSyntax library
1 parent 9cff065 commit efec348

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,10 @@ predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode n) {
200200
)
201201
}
202202

203-
bindingset[s]
204-
private int parsePosition(string s) {
205-
result = s.regexpCapture("([-0-9]+)", 1).toInt()
206-
or
207-
exists(int n1, int n2 |
208-
s.regexpCapture("([-0-9]+)\\.\\.([0-9]+)", 1).toInt() = n1 and
209-
s.regexpCapture("([-0-9]+)\\.\\.([0-9]+)", 2).toInt() = n2 and
210-
result in [n1 .. n2]
211-
)
212-
}
213-
214203
/** Gets the argument position obtained by parsing `X` in `Parameter[X]`. */
215204
bindingset[s]
216-
ArgumentPosition parseParamBody(string s) { result = parsePosition(s) }
205+
ArgumentPosition parseParamBody(string s) { result = AccessPath::parseInt(s) }
217206

218207
/** Gets the parameter position obtained by parsing `X` in `Argument[X]`. */
219208
bindingset[s]
220-
ParameterPosition parseArgBody(string s) { result = parsePosition(s) }
209+
ParameterPosition parseArgBody(string s) { result = AccessPath::parseInt(s) }

0 commit comments

Comments
 (0)