Skip to content

Commit 86d5393

Browse files
committed
Java: Improve MemberRefExpr.getReceiverType() documentation
1 parent 43b7bc5 commit 86d5393

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,9 @@ class MemberRefExpr extends FunctionalExpr, @memberref {
12271227

12281228
/**
12291229
* Gets the receiver type whose member this expression refers to. The result might not be
1230-
* the type which actually declares the member (makes a difference for inherited non-overridden
1231-
* methods).
1230+
* the type which actually declares the member. For example, for the member reference `ArrayList::toString`,
1231+
* this predicate has the result `java.util.ArrayList`, the type explicitly referred to, while
1232+
* `getReferencedCallable` will have `java.util.AbstractCollection.toString` as result, which `ArrayList` inherits.
12321233
*/
12331234
RefType getReceiverType() {
12341235
exists(Stmt stmt, Expr resultExpr |

0 commit comments

Comments
 (0)