Skip to content

Commit a73f73c

Browse files
committed
Java: The qualifier is selected using this instead of -1.
1 parent 6afdaa3 commit a73f73c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-java.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ This means that we want to add tuples to the **summaryModel**\(package, type, su
155155
pack: codeql/java-all
156156
extensible: summaryModel
157157
data:
158-
- ["java.lang", "String", False, "concat", "(String)", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
158+
- ["java.lang", "String", False, "concat", "(String)", "", "Argument[this]", "ReturnValue", "taint", "manual"]
159159
- ["java.lang", "String", False, "concat", "(String)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
160160
161161
Reasoning:
@@ -176,7 +176,7 @@ These are the same for both of the rows above as we are adding two summaries for
176176
The sixth value is only relevant internally and can be omitted in most use cases.
177177
The remaining values are used to define the **access path**, the **kind**, and the **provenance** (origin) of the summary.
178178

179-
- The seventh value is the access path to the input (where data flows from). **Argument[-1]** is the access path to the qualifier (**s1** in the example) and **Argument[0]** is the access path to the first argument (**s2** in the example).
179+
- The seventh value is the access path to the input (where data flows from). **Argument[this]** is the access path to the qualifier (**s1** in the example) and **Argument[0]** is the access path to the first argument (**s2** in the example).
180180
- The eighth value **ReturnValue** is the access path to the output (where data flows to), in this case **ReturnValue**, which means that the input flows to the return value.
181181
- The ninth value **taint** is the kind of the flow. **taint** means that taint is propagated through the call.
182182
- The tenth value **manual** is the provenance of the summary, which is used to identify the origin of the summary.
@@ -203,7 +203,7 @@ This can be achieved by adding the following to a data extension file:
203203
pack: codeql/java-all
204204
extensible: summaryModel
205205
data:
206-
- ["java.util.stream", "Stream", True, "map", "(Function)", "", "Argument[-1].Element", "Argument[0].Parameter[0]", "value", "manual"]
206+
- ["java.util.stream", "Stream", True, "map", "(Function)", "", "Argument[this].Element", "Argument[0].Parameter[0]", "value", "manual"]
207207
- ["java.util.stream", "Stream", True, "map", "(Function)", "", "Argument[0].ReturnValue", "ReturnValue.Element", "value", "manual"]
208208
209209
Reasoning:
@@ -227,7 +227,7 @@ The remaining values are used to define the **access path**, the **kind**, and t
227227

228228
For the first row the
229229

230-
- The seventh value is **Argument[-1].Element**, which is the access path to the elements of the qualifier (the elements of the stream **s** in the example).
230+
- The seventh value is **Argument[this].Element**, which is the access path to the elements of the qualifier (the elements of the stream **s** in the example).
231231
- The eight value is **Argument[0].Parameter[0]**, which is the access path to the first parameter of the **Function** argument of **map** (the lambda parameter **e** in the example).
232232

233233
For the second row the
@@ -394,7 +394,7 @@ The **input**, and **output** columns consist of a **.**-separated list of compo
394394
The following components are supported:
395395

396396
- **Argument[**\ `n`\ **]** selects the argument at index `n` (zero-indexed).
397-
- **Argument[**\ `-1`\ **]** selects the qualifier (instance parameter).
397+
- **Argument[**\ `this`\ **]** selects the qualifier (instance parameter).
398398
- **Argument[**\ `n1..n2`\ **]** selects the arguments in the given range (both ends included).
399399
- **Parameter[**\ `n`\ **]** selects the parameter at index `n` (zero-indexed).
400400
- **Parameter[**\ `n1..n2`\ **]** selects the parameters in the given range (both ends included).

0 commit comments

Comments
 (0)