Skip to content

Commit 97e0b4e

Browse files
committed
Use parameter name to only select correct overloads
1 parent 9f2a7f7 commit 97e0b4e

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

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

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,7 @@ private class SpringRestTemplateMethodWithUriVariablesParameter extends Method {
4242

4343
SpringRestTemplateMethodWithUriVariablesParameter() {
4444
this.getDeclaringType() instanceof SpringRestTemplate and
45-
(
46-
this.hasName("delete") and pos = 1
47-
or
48-
this.hasName("exchange") and pos = 4
49-
or
50-
this.hasName("execute") and pos = 4
51-
or
52-
this.hasName("getForEntity") and pos = 2
53-
or
54-
this.hasName("getForObject") and pos = 2
55-
or
56-
this.hasName("headForHeaders") and pos = 1
57-
or
58-
this.hasName("optionsForAllow") and pos = 1
59-
or
60-
this.hasName("patchForObject") and pos = 3
61-
or
62-
this.hasName("postForEntity") and pos = 3
63-
or
64-
this.hasName("postForLocation") and pos = 2
65-
or
66-
this.hasName("postForObject") and pos = 3
67-
or
68-
this.hasName("put") and pos = 2
69-
)
45+
this.getParameter(pos).getName() = "uriVariables"
7046
}
7147

7248
int getUriVariablesPosition() { result = pos }

0 commit comments

Comments
 (0)