Class InstanceAccessExt
A generalization of InstanceAccess that includes implicit accesses.
The accesses can be divided into 6 kinds:
- Explicit: Represented by an
InstanceAccess. - Implicit field qualifier: The implicit access associated with an
unqualified
FieldAccessto a non-static field. - Implicit method qualifier: The implicit access associated with an
unqualified
MethodCallto a non-static method. - Implicit this constructor argument: The implicit argument of the value of
thisto a constructor call of the formthis()orsuper(). - Implicit enclosing instance capture: The implicit capture of the value of the directly enclosing instance of a constructed inner class. This is associated with an unqualified constructor call.
- Implicit enclosing instance qualifier: The instance access that occurs as the implicit qualifier of a desugared enclosing instance access.
Of these 6 kinds, the fourth (implicit this constructor argument) is always
an OwnInstanceAccess, whereas the other 5 can be either OwnInstanceAccess
or EnclosingInstanceAccess.
Import path
import semmle.code.java.dataflow.InstanceAccessDirect supertypes
Known direct subtypes
Predicates
| getCfgNode | Gets the control flow node associated with this instance access. |
| getEnclosingCallable | Gets the callable in which this instance access occurs. |
| getLocation | Gets the source location for this element. |
| getType | Gets the type of this instance access. |
| isEnclosingInstanceAccess | Holds if this is an access to an enclosing instance. |
| isExplicit | Holds if this is the explicit instance access |
| isImplicitEnclosingInstanceCapture | Holds if this is the implicit qualifier of |
| isImplicitEnclosingInstanceQualifier | Holds if this is the implicit qualifier of the desugared enclosing instance access |
| isImplicitFieldQualifier | Holds if this is the implicit qualifier of |
| isImplicitMethodQualifier | Holds if this is the implicit qualifier of |
| isImplicitThisConstructorArgument | Holds if this is the implicit |
| isOwnInstanceAccess | Holds if this is an access to an object’s own instance. |
| toString | Gets a textual representation of this element. |