mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: try simplification of paramsString and paramsStringPart
This commit is contained in:
@@ -336,18 +336,6 @@ private predicate elementSpec(
|
||||
neutralModel(package, type, name, signature, _) and ext = "" and subtypes = false
|
||||
}
|
||||
|
||||
private string paramsStringPart(Callable c, int i) {
|
||||
i = -1 and result = "("
|
||||
or
|
||||
exists(int n, string p | c.getParameterType(n).getErasure().toString() = p |
|
||||
i = 2 * n and result = p
|
||||
or
|
||||
i = 2 * n - 1 and result = "," and n != 0
|
||||
)
|
||||
or
|
||||
i = 2 * c.getNumberOfParameters() and result = ")"
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a parenthesized string containing all parameter types of this callable, separated by a comma.
|
||||
*
|
||||
@@ -355,7 +343,10 @@ private string paramsStringPart(Callable c, int i) {
|
||||
* Parameter types are represented by their type erasure.
|
||||
*/
|
||||
cached
|
||||
string paramsString(Callable c) { result = concat(int i | | paramsStringPart(c, i) order by i) }
|
||||
string paramsString(Callable c) {
|
||||
result =
|
||||
"(" + concat(int i | | c.getParameterType(i).getErasure().toString(), "," order by i) + ")"
|
||||
}
|
||||
|
||||
private Element interpretElement0(
|
||||
string package, string type, boolean subtypes, string name, string signature
|
||||
|
||||
Reference in New Issue
Block a user