Class MethodCall
- java.lang.Object
-
- org.checkerframework.dataflow.expression.JavaExpression
-
- org.checkerframework.dataflow.expression.MethodCall
-
public class MethodCall extends JavaExpression
A call to a @Deterministic method.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<JavaExpression>argumentsThe arguments.protected javax.lang.model.element.ExecutableElementmethodThe method being called.protected JavaExpressionreceiverThe receiver argument.-
Fields inherited from class org.checkerframework.dataflow.expression.JavaExpression
type
-
-
Constructor Summary
Constructors Constructor Description MethodCall(javax.lang.model.type.TypeMirror type, javax.lang.model.element.ExecutableElement method, JavaExpression receiver, java.util.List<JavaExpression> arguments)Creates a new MethodCall.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(JavaExpressionVisitor<R,P> visitor, P p)Accept method of the visitor pattern.booleancontainsModifiableAliasOf(Store<?> store, JavaExpression other)Returns true if and only ifotherappears anywhere in this or an expression appears in this such thatothermight alias this expression, and that expression is modifiable.booleancontainsOfClass(java.lang.Class<? extends JavaExpression> clazz)booleancontainsSyntacticEqualJavaExpression(JavaExpression other)Returns true if and only if this contains a JavaExpression that is syntactically equal toother.booleanequals(@Nullable java.lang.Object obj)java.util.List<JavaExpression>getArguments()Returns the method call arguments (for inspection only - do not modify any of the arguments).javax.lang.model.element.ExecutableElementgetElement()Returns the ExecutableElement for the method call.JavaExpressiongetReceiver()Returns the method call receiver (for inspection only - do not modify).inthashCode()booleanisDeterministic(AnnotationProvider provider)Returns true if the expression is deterministic.booleanisUnassignableByOtherCode()Returns true if and only if the value this expression stands for cannot be changed (with respect to ==) by a method call.booleanisUnmodifiableByOtherCode()Returns true if and only if the value this expression stands for cannot be changed by a method call, including changes to any of its fields.booleansyntacticEquals(JavaExpression je)Returns true if and only if the two Java expressions are syntactically identical.java.lang.StringtoString()-
Methods inherited from class org.checkerframework.dataflow.expression.JavaExpression
atConstructorInvocation, atFieldAccess, atMethodBody, atMethodInvocation, atMethodInvocation, containsUnknown, fromArrayAccess, fromNode, fromNodeFieldAccess, fromTree, fromVariableTree, getFormalParameters, getImplicitReceiver, getParametersAsLocalVariables, getPseudoReceiver, getReceiver, getType, listContainsSyntacticEqualJavaExpression, listIsDeterministic, syntacticEqualsList, toStringDebug
-
-
-
-
Field Detail
-
method
protected final javax.lang.model.element.ExecutableElement method
The method being called.
-
receiver
protected final JavaExpression receiver
The receiver argument.
-
arguments
protected final java.util.List<JavaExpression> arguments
The arguments.
-
-
Constructor Detail
-
MethodCall
public MethodCall(javax.lang.model.type.TypeMirror type, javax.lang.model.element.ExecutableElement method, JavaExpression receiver, java.util.List<JavaExpression> arguments)Creates a new MethodCall.- Parameters:
type- the type of the method callmethod- the method being calledreceiver- the receiver argumentarguments- the arguments
-
-
Method Detail
-
getElement
public javax.lang.model.element.ExecutableElement getElement()
Returns the ExecutableElement for the method call.- Returns:
- the ExecutableElement for the method call
-
getReceiver
public JavaExpression getReceiver()
Returns the method call receiver (for inspection only - do not modify).- Returns:
- the method call receiver (for inspection only - do not modify)
-
getArguments
public java.util.List<JavaExpression> getArguments()
Returns the method call arguments (for inspection only - do not modify any of the arguments).- Returns:
- the method call arguments (for inspection only - do not modify any of the arguments)
-
containsOfClass
public boolean containsOfClass(java.lang.Class<? extends JavaExpression> clazz)
- Specified by:
containsOfClassin classJavaExpression
-
isDeterministic
public boolean isDeterministic(AnnotationProvider provider)
Description copied from class:JavaExpressionReturns true if the expression is deterministic.- Specified by:
isDeterministicin classJavaExpression- Parameters:
provider- an annotation provider (a type factory)- Returns:
- true if this expression is deterministic
-
isUnassignableByOtherCode
public boolean isUnassignableByOtherCode()
Description copied from class:JavaExpressionReturns true if and only if the value this expression stands for cannot be changed (with respect to ==) by a method call. This is the case for local variables, the self reference, final field accesses whose receiver isJavaExpression.isUnassignableByOtherCode(), and operations whose operands are allJavaExpression.isUnmodifiableByOtherCode().- Specified by:
isUnassignableByOtherCodein classJavaExpression- See Also:
JavaExpression.isUnmodifiableByOtherCode()
-
isUnmodifiableByOtherCode
public boolean isUnmodifiableByOtherCode()
Description copied from class:JavaExpressionReturns true if and only if the value this expression stands for cannot be changed by a method call, including changes to any of its fields.Approximately, this returns true if the expression is
JavaExpression.isUnassignableByOtherCode()and its type is immutable.- Specified by:
isUnmodifiableByOtherCodein classJavaExpression- See Also:
JavaExpression.isUnassignableByOtherCode()
-
syntacticEquals
public boolean syntacticEquals(JavaExpression je)
Description copied from class:JavaExpressionReturns true if and only if the two Java expressions are syntactically identical.This exists for use by
JavaExpression.containsSyntacticEqualJavaExpression(org.checkerframework.dataflow.expression.JavaExpression).- Specified by:
syntacticEqualsin classJavaExpression- Parameters:
je- the other Java expression to compare to this one- Returns:
- true if and only if the two Java expressions are syntactically identical
-
containsSyntacticEqualJavaExpression
public boolean containsSyntacticEqualJavaExpression(JavaExpression other)
Description copied from class:JavaExpressionReturns true if and only if this contains a JavaExpression that is syntactically equal toother.- Specified by:
containsSyntacticEqualJavaExpressionin classJavaExpression- Parameters:
other- the JavaExpression to search for- Returns:
- true if and only if this contains a JavaExpression that is syntactically equal to
other
-
containsModifiableAliasOf
public boolean containsModifiableAliasOf(Store<?> store, JavaExpression other)
Description copied from class:JavaExpressionReturns true if and only ifotherappears anywhere in this or an expression appears in this such thatothermight alias this expression, and that expression is modifiable.This is always true, except for cases where the Java type information prevents aliasing and none of the subexpressions can alias 'other'.
- Overrides:
containsModifiableAliasOfin classJavaExpression
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public <R,P> R accept(JavaExpressionVisitor<R,P> visitor, P p)
Description copied from class:JavaExpressionAccept method of the visitor pattern.- Specified by:
acceptin classJavaExpression- Type Parameters:
R- result type of the operationP- parameter type- Parameters:
visitor- the visitor to be applied to this JavaExpressionp- the parameter for this operation- Returns:
- the result of visiting this
-
-