mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Merge pull request #13143 from kaspersv/kaspersv/java-explicit-this-receivers2
Java: Make implicit this receivers explicit
This commit is contained in:
@@ -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))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ dependencies:
|
||||
codeql/util: ${workspace}
|
||||
dataExtensions:
|
||||
- Telemetry/ExtractorInformation.yml
|
||||
warnOmImplicitThis: true
|
||||
warnOnImplicitThis: true
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user