Skip to content

Commit be1d4c0

Browse files
committed
Java: Fix external flow perofrmance with future optimiser.
1 parent 726feb3 commit be1d4c0

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,21 @@ private predicate elementSpec(
616616
summaryModel(namespace, type, subtypes, name, signature, ext, _, _, _)
617617
}
618618

619+
private predicate relevantCallable(Callable c) { elementSpec(_, _, _, c.getName(), _, _) }
620+
619621
private string paramsStringPart(Callable c, int i) {
620-
i = -1 and result = "("
621-
or
622-
exists(int n, string p | c.getParameterType(n).getErasure().toString() = p |
623-
i = 2 * n and result = p
622+
relevantCallable(c) and
623+
(
624+
i = -1 and result = "("
624625
or
625-
i = 2 * n - 1 and result = "," and n != 0
626+
exists(int n, string p | c.getParameterType(n).getErasure().toString() = p |
627+
i = 2 * n and result = p
628+
or
629+
i = 2 * n - 1 and result = "," and n != 0
630+
)
631+
or
632+
i = 2 * c.getNumberOfParameters() and result = ")"
626633
)
627-
or
628-
i = 2 * c.getNumberOfParameters() and result = ")"
629634
}
630635

631636
private string paramsString(Callable c) {

0 commit comments

Comments
 (0)