Merge pull request #13143 from kaspersv/kaspersv/java-explicit-this-receivers2

Java: Make implicit this receivers explicit
This commit is contained in:
Kasper Svendsen
2023-05-12 15:22:15 +02:00
committed by GitHub
3 changed files with 10 additions and 10 deletions

View File

@@ -27,8 +27,8 @@ deprecated class CamelToURI = CamelToUri;
class CamelToBeanUri extends CamelToUri {
CamelToBeanUri() {
// A `<to>` element references a bean if the URI starts with "bean:", or there is no scheme.
matches("bean:%") or
not exists(indexOf(":"))
this.matches("bean:%") or
not exists(this.indexOf(":"))
}
/**
@@ -38,13 +38,13 @@ class CamelToBeanUri extends CamelToUri {
* parameter parts are optional.
*/
string getBeanIdentifier() {
if not exists(indexOf(":"))
if not exists(this.indexOf(":"))
then result = this
else
exists(int start | start = indexOf(":", 0, 0) + 1 |
if not exists(indexOf("?"))
then result = suffix(start)
else result = substring(start, indexOf("?", 0, 0))
exists(int start | start = this.indexOf(":", 0, 0) + 1 |
if not exists(this.indexOf("?"))
then result = this.suffix(start)
else result = this.substring(start, this.indexOf("?", 0, 0))
)
}

View File

@@ -12,4 +12,4 @@ dependencies:
codeql/util: ${workspace}
dataExtensions:
- Telemetry/ExtractorInformation.yml
warnOmImplicitThis: true
warnOnImplicitThis: true

View File

@@ -73,7 +73,7 @@ class InlineFlowTest extends InlineExpectationsTest {
override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasValueFlow" and
exists(DataFlow::Node src, DataFlow::Node sink | hasValueFlow(src, sink) |
exists(DataFlow::Node src, DataFlow::Node sink | this.hasValueFlow(src, sink) |
sink.getLocation() = location and
element = sink.toString() and
if exists(getSourceArgString(src)) then value = getSourceArgString(src) else value = ""
@@ -81,7 +81,7 @@ class InlineFlowTest extends InlineExpectationsTest {
or
tag = "hasTaintFlow" and
exists(DataFlow::Node src, DataFlow::Node sink |
hasTaintFlow(src, sink) and not hasValueFlow(src, sink)
this.hasTaintFlow(src, sink) and not this.hasValueFlow(src, sink)
|
sink.getLocation() = location and
element = sink.toString() and