Skip to content

Commit 21fc06c

Browse files
authored
Change MethodAccess to MethodCall in query example
MethodAccess has been deprecated.
1 parent 3230df0 commit 21fc06c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/codeql/codeql-language-guides/basic-query-for-java-code.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Running a quick query
4242

4343
.. code-block:: ql
4444
45-
from MethodAccess ma
45+
from MethodCall ma
4646
where
4747
ma.getMethod().hasName("equals") and
4848
ma.getArgument(0).(StringLiteral).getValue() = ""
@@ -72,9 +72,9 @@ After the initial ``import`` statement, this simple query comprises three parts
7272
+==================================================================================================+===================================================================================================================+===================================================================================================+
7373
| ``import java`` | Imports the standard CodeQL libraries for Java and Kotlin. | Every query begins with one or more ``import`` statements. |
7474
+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
75-
| ``from MethodAccess ma`` | Defines the variables for the query. | We use: |
75+
| ``from MethodCall ma`` | Defines the variables for the query. | We use: |
7676
| | Declarations are of the form: | |
77-
| | ``<type> <variable name>`` | - a ``MethodAccess`` variable for call expressions |
77+
| | ``<type> <variable name>`` | - a ``MethodCall`` variable for call expressions |
7878
+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
7979
| ``where ma.getMethod().hasName("equals") and ma.getArgument(0).(StringLiteral).getValue() = ""`` | Defines a condition on the variables. | ``ma.getMethod().hasName("equals")`` restricts ``ma`` to only calls to methods call ``equals``. |
8080
| | | |
@@ -141,4 +141,4 @@ Further reading
141141

142142
.. |image-quick-query| image:: ../images/codeql-for-visual-studio-code/quick-query-tab-java.png
143143

144-
.. |result-col-1| replace:: The first column corresponds to the expression ``ma`` and is linked to the location in the source code of the project where ``ma`` occurs.
144+
.. |result-col-1| replace:: The first column corresponds to the expression ``ma`` and is linked to the location in the source code of the project where ``ma`` occurs.

0 commit comments

Comments
 (0)