Skip to content

Commit d27f84e

Browse files
authored
Merge pull request github#13143 from kaspersv/kaspersv/java-explicit-this-receivers2
Java: Make implicit this receivers explicit
2 parents 48f2268 + d40cd0f commit d27f84e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

java/ql/lib/semmle/code/java/frameworks/Camel.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ deprecated class CamelToURI = CamelToUri;
2727
class CamelToBeanUri extends CamelToUri {
2828
CamelToBeanUri() {
2929
// A `<to>` element references a bean if the URI starts with "bean:", or there is no scheme.
30-
matches("bean:%") or
31-
not exists(indexOf(":"))
30+
this.matches("bean:%") or
31+
not exists(this.indexOf(":"))
3232
}
3333

3434
/**
@@ -38,13 +38,13 @@ class CamelToBeanUri extends CamelToUri {
3838
* parameter parts are optional.
3939
*/
4040
string getBeanIdentifier() {
41-
if not exists(indexOf(":"))
41+
if not exists(this.indexOf(":"))
4242
then result = this
4343
else
44-
exists(int start | start = indexOf(":", 0, 0) + 1 |
45-
if not exists(indexOf("?"))
46-
then result = suffix(start)
47-
else result = substring(start, indexOf("?", 0, 0))
44+
exists(int start | start = this.indexOf(":", 0, 0) + 1 |
45+
if not exists(this.indexOf("?"))
46+
then result = this.suffix(start)
47+
else result = this.substring(start, this.indexOf("?", 0, 0))
4848
)
4949
}
5050

java/ql/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ dependencies:
1212
codeql/util: ${workspace}
1313
dataExtensions:
1414
- Telemetry/ExtractorInformation.yml
15-
warnOmImplicitThis: true
15+
warnOnImplicitThis: true

java/ql/test/TestUtilities/InlineFlowTest.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ class InlineFlowTest extends InlineExpectationsTest {
7373

7474
override predicate hasActualResult(Location location, string element, string tag, string value) {
7575
tag = "hasValueFlow" and
76-
exists(DataFlow::Node src, DataFlow::Node sink | hasValueFlow(src, sink) |
76+
exists(DataFlow::Node src, DataFlow::Node sink | this.hasValueFlow(src, sink) |
7777
sink.getLocation() = location and
7878
element = sink.toString() and
7979
if exists(getSourceArgString(src)) then value = getSourceArgString(src) else value = ""
8080
)
8181
or
8282
tag = "hasTaintFlow" and
8383
exists(DataFlow::Node src, DataFlow::Node sink |
84-
hasTaintFlow(src, sink) and not hasValueFlow(src, sink)
84+
this.hasTaintFlow(src, sink) and not this.hasValueFlow(src, sink)
8585
|
8686
sink.getLocation() = location and
8787
element = sink.toString() and

0 commit comments

Comments
 (0)