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 Details

  • Constructor Details

    • MethodCall

      public MethodCall(TypeMirror type, ExecutableElement method, JavaExpression receiver, List<JavaExpression> arguments)
      Creates a new MethodCall.
      Parameters:
      type - the type of the method call
      method - the method being called
      receiver - the receiver argument
      arguments - the arguments
  • Method Details

    • getElement

      public 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 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(Class<? extends JavaExpression> clazz)
      Specified by:
      containsOfClass in class JavaExpression
    • isDeterministic

      public boolean isDeterministic(org.checkerframework.javacutil.AnnotationProvider provider)
      Description copied from class: JavaExpression
      Returns true if the expression is deterministic.
      Specified by:
      isDeterministic in class JavaExpression
      Parameters:
      provider - an annotation provider (a type factory)
      Returns:
      true if this expression is deterministic
    • isUnassignableByOtherCode

      public boolean isUnassignableByOtherCode()
      Description copied from class: JavaExpression
      Returns 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 is JavaExpression.isUnassignableByOtherCode(), and operations whose operands are all JavaExpression.isUnmodifiableByOtherCode().
      Specified by:
      isUnassignableByOtherCode in class JavaExpression
      See Also:
    • isUnmodifiableByOtherCode

      public boolean isUnmodifiableByOtherCode()
      Description copied from class: JavaExpression
      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.

      Approximately, this returns true if the expression is JavaExpression.isUnassignableByOtherCode() and its type is immutable.

      Specified by:
      isUnmodifiableByOtherCode in class JavaExpression
      See Also:
    • syntacticEquals

      public boolean syntacticEquals(JavaExpression je)
      Description copied from class: JavaExpression
      Returns 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:
      syntacticEquals in class JavaExpression
      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: JavaExpression
      Returns true if and only if this contains a JavaExpression that is syntactically equal to other.
      Specified by:
      containsSyntacticEqualJavaExpression in class JavaExpression
      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: JavaExpression
      Returns true if and only if other appears anywhere in this or an expression appears in this such that other might 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:
      containsModifiableAliasOf in class JavaExpression
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • accept

      public <R, P> R accept(JavaExpressionVisitor<R,P> visitor, P p)
      Description copied from class: JavaExpression
      Accept method of the visitor pattern.
      Specified by:
      accept in class JavaExpression
      Type Parameters:
      R - result type of the operation
      P - parameter type
      Parameters:
      visitor - the visitor to be applied to this JavaExpression
      p - the parameter for this operation
      Returns:
      the result of visiting this