Class ArrayCreation
java.lang.Object
org.checkerframework.dataflow.expression.JavaExpression
org.checkerframework.dataflow.expression.ArrayCreation
JavaExpression for array creations.
new String[]().-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<@Nullable JavaExpression>List of dimensions expressions.protected final List<JavaExpression>List of initializers.Fields inherited from class org.checkerframework.dataflow.expression.JavaExpression
type -
Constructor Summary
ConstructorsConstructorDescriptionArrayCreation(TypeMirror type, List<@Nullable JavaExpression> dimensions, List<JavaExpression> initializers) Creates an ArrayCreation object. -
Method Summary
Modifier and TypeMethodDescription<R,P> R accept(JavaExpressionVisitor<R, P> visitor, P p) Accept method of the visitor pattern.booleancontainsOfClass(Class<? extends JavaExpression> clazz) booleanReturns true if and only if this contains a JavaExpression that is syntactically equal toother.booleanReturns a list representing the dimensions of this array creation.inthashCode()booleanisDeterministic(AnnotationProvider provider) Returns true if the expression is deterministic.booleanReturns true if and only if the value this expression stands for cannot be changed (with respect to ==) by a method call.booleanReturns 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.booleanReturns true if and only if the two Java expressions are syntactically identical.toString()Format this verbosely, for debugging.Methods inherited from class org.checkerframework.dataflow.expression.JavaExpression
atConstructorInvocation, atFieldAccess, atMethodBody, atMethodInvocation, atMethodInvocation, containsModifiableAliasOf, containsUnknown, fromArrayAccess, fromNode, fromNodeFieldAccess, fromTree, fromVariableTree, getFormalParameters, getImplicitReceiver, getParametersAsLocalVariables, getPseudoReceiver, getReceiver, getType, listContainsSyntacticEqualJavaExpression, listIsDeterministic, syntacticEqualsList
-
Field Details
-
dimensions
List of dimensions expressions. A {code null} element means that there is no dimension expression for the given array level. -
initializers
List of initializers.
-
-
Constructor Details
-
ArrayCreation
public ArrayCreation(TypeMirror type, List<@Nullable JavaExpression> dimensions, List<JavaExpression> initializers) Creates an ArrayCreation object.- Parameters:
type- array typedimensions- list of dimension expressions; anullelement means that there is no dimension expression for the given array levelinitializers- list of initializer expressions
-
-
Method Details
-
getDimensions
Returns a list representing the dimensions of this array creation. A {code null} element means that there is no dimension expression for the given array level.- Returns:
- a list representing the dimensions of this array creation
-
getInitializers
-
containsOfClass
- Specified by:
containsOfClassin classJavaExpression
-
isDeterministic
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:
-
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:
-
hashCode
public int hashCode() -
equals
-
syntacticEquals
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
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
-
toString
-
toStringDebug
Description copied from class:JavaExpressionFormat this verbosely, for debugging.- Overrides:
toStringDebugin classJavaExpression- Returns:
- a verbose string representation of this
-
accept
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
-