Skip to content

Commit 12d0f1a

Browse files
authored
Merge pull request github#14575 from github/smowton/feature/more-intuitive-java-class-names
Java: Replace MethodAccess, LValue, RValue with more intuitive names. Introduce NewClassExpr.
2 parents 790615f + 30610c9 commit 12d0f1a

File tree

458 files changed

+2450
-2375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

458 files changed

+2450
-2375
lines changed

docs/codeql/ql-training/query-examples/java/data-flow-java-1.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class StringConcat extends AddExpr {
44
StringConcat() { getType() instanceof TypeString }
55
}
66

7-
from MethodAccess ma
7+
from MethodCall ma
88
where
99
ma.getMethod().getName().matches("sparql%Query") and
1010
ma.getArgument(0) instanceof StringConcat

docs/codeql/ql-training/query-examples/java/data-flow-java-2.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java
22
import semmle.code.java.dataflow.DataFlow::DataFlow
33

4-
from MethodAccess ma, StringConcat stringConcat
4+
from MethodCall ma, StringConcat stringConcat
55
where
66
ma.getMethod().getName().matches("sparql%Query") and
77
localFlow(exprNode(stringConcat), exprNode(ma.getArgument(0)))

docs/codeql/ql-training/query-examples/java/query-injection-java-1.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import java
22

3-
from Method m, MethodAccess ma
3+
from Method m, MethodCall ma
44
where
55
m.getName().matches("sparql%Query") and
66
ma.getMethod() = m

docs/codeql/ql-training/query-examples/java/query-injection-java-2.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import java
22

3-
from Method m, MethodAccess ma
3+
from Method m, MethodCall ma
44
where
55
m.getName().matches("sparql%Query") and
66
ma.getMethod() = m and

docs/codeql/ql-training/query-examples/java/query-injection-java-3.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import java
22

33
predicate isStringConcat(AddExpr ae) { ae.getType() instanceof TypeString }
44

5-
from Method m, MethodAccess ma
5+
from Method m, MethodCall ma
66
where
77
m.getName().matches("sparql%Query") and
88
ma.getMethod() = m and

java/ql/consistency-queries/calls.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import java
22

3-
from MethodAccess ma
3+
from MethodCall ma
44
// Generally Kotlin calls will always use an explicit qualifier, except for calls
55
// to the synthetic instance initializer <obinit>, which use an implicit `this`.
66
where

java/ql/consistency-queries/cfgDeadEnds.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ predicate shouldBeDeadEnd(ControlFlowNode n) {
4444
or
4545
n instanceof WildcardTypeAccess // TODO
4646
or
47-
n instanceof MethodAccess // TODO
47+
n instanceof MethodCall // TODO
4848
or
4949
n instanceof Method
5050
or

java/ql/consistency-queries/children.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ predicate gapInChildren(Element e, int i) {
3737
// For statements may or may not declare a new variable (child 0), or
3838
// have a condition (child 1).
3939
not (e instanceof ForStmt and i = [0, 1]) and
40-
// TODO: Clarify situation with Kotlin and MethodAccess.
40+
// TODO: Clarify situation with Kotlin and MethodCall.
4141
// -1 can be skipped (type arguments from -2 down, no qualifier at -1,
4242
// then arguments from 0).
4343
// Can we also skip arguments, e.g. due to defaults for parameters?
44-
not (e instanceof MethodAccess and e.getFile().isKotlinSourceFile()) and
44+
not (e instanceof MethodCall and e.getFile().isKotlinSourceFile()) and
4545
// Kotlin-extracted annotations can have missing children where a default
4646
// value should be, because kotlinc doesn't load annotation defaults and we
4747
// want to leave a space for another extractor to fill in the default if it

java/ql/examples/snippets/method_call.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import java
1010

11-
from MethodAccess call, Method method
11+
from MethodCall call, Method method
1212
where
1313
call.getMethod() = method and
1414
method.hasName("methodName") and

java/ql/examples/snippets/mutualrecursion.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java
1010

1111
from Method m, Method n
1212
where
13-
exists(MethodAccess ma | ma.getCaller() = m and ma.getCallee() = n) and
14-
exists(MethodAccess ma | ma.getCaller() = n and ma.getCallee() = m) and
13+
exists(MethodCall ma | ma.getCaller() = m and ma.getCallee() = n) and
14+
exists(MethodCall ma | ma.getCaller() = n and ma.getCallee() = m) and
1515
m != n
1616
select m, n

0 commit comments

Comments
 (0)