Class LocalVariable
This class also represents a formal parameter expressed using its name. Class FormalParameter represents a formal parameter expressed using the "#2" notation.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final VariableElementThe element for this local variable.Fields inherited from class org.checkerframework.dataflow.expression.JavaExpressiontype
- 
Constructor SummaryConstructorsConstructorDescriptionLocalVariable(VariableElement element) Creates a new LocalVariable.LocalVariable(LocalVariableNode localVar) Creates a new LocalVariable.
- 
Method SummaryModifier and TypeMethodDescription<R,P> R accept(JavaExpressionVisitor<R, P> visitor, P p) Accept method of the visitor pattern.<T extends JavaExpression>
 @Nullable TcontainedOfClass(Class<T> clazz) Returns the first subexpression whose class is the given class, or null.booleanReturns true if and only if this contains a JavaExpression that is syntactically equal toother.booleanReturns the element for this variable.inthashCode()booleanReturns true if some subexpression of this can be assigned to from outside the current method body.booleanisDeterministic(AnnotationProvider provider) Returns true if the expression is deterministic.booleanReturns true if the value this expression stands for can be changed by a method call; equivalently, if the value this expression evaluates to can be changed by a side effect from outside the containing method.protected static booleansameElement(VariableElement element1, VariableElement element2) Returns true if the two elements are the same.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.JavaExpressionatConstructorInvocation, atFieldAccess, atMethodBody, atMethodInvocation, atMethodInvocation, containedUnknown, containsModifiableAliasOf, containsOfClass, containsUnknown, fromArrayAccess, fromNode, fromNodeFieldAccess, fromTree, fromVariableTree, getFormalParameters, getImplicitReceiver, getParametersAsLocalVariables, getPseudoReceiver, getReceiver, getType, isUnassignableByOtherCode, isUnmodifiableByOtherCode, listContainsSyntacticEqualJavaExpression, listIsDeterministic, syntacticEqualsList
- 
Field Details- 
elementThe element for this local variable.
 
- 
- 
Constructor Details- 
LocalVariableCreates a new LocalVariable.- Parameters:
- localVar- a CFG local variable
 
- 
LocalVariableCreates a new LocalVariable.- Parameters:
- element- the element for the local variable
 
 
- 
- 
Method Details- 
equals
- 
sameElementReturns true if the two elements are the same.- Parameters:
- element1- the first element to compare
- element2- the second element to compare
- Returns:
- true if the two elements are the same
 
- 
getElementReturns the element for this variable.- Returns:
- the element for this variable
 
- 
hashCodepublic int hashCode()
- 
toString
- 
toStringDebugDescription copied from class:JavaExpressionFormat this verbosely, for debugging.- Overrides:
- toStringDebugin class- JavaExpression
- Returns:
- a verbose string representation of this
 
- 
containedOfClassDescription copied from class:JavaExpressionReturns the first subexpression whose class is the given class, or null.This is intended as a diagnostic aid; most clients will use JavaExpression.containsOfClass(java.lang.Class<? extends org.checkerframework.dataflow.expression.JavaExpression>).- Specified by:
- containedOfClassin class- JavaExpression
- Type Parameters:
- T- the type corresponding to- clazz
- Parameters:
- clazz- the JavaExpression subclass to search for
- Returns:
- true if some subexpression whose class is the given class
 
- 
isDeterministicDescription copied from class:JavaExpressionReturns true if the expression is deterministic.- Specified by:
- isDeterministicin class- JavaExpression
- Parameters:
- provider- an annotation provider (a type factory)
- Returns:
- true if this expression is deterministic
 
- 
syntacticEqualsDescription 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 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
 
- 
containsSyntacticEqualJavaExpressionDescription copied from class:JavaExpressionReturns true if and only if this contains a JavaExpression that is syntactically equal toother.- Specified by:
- containsSyntacticEqualJavaExpressionin 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
 
- 
isAssignableByOtherCodepublic boolean isAssignableByOtherCode()Description copied from class:JavaExpressionReturns true if some subexpression of this can be assigned to from outside the current method body.This is false for local variables, the self reference, final field accesses whose receiver is JavaExpression.isUnassignableByOtherCode(), and operations whose operands are all notJavaExpression.isModifiableByOtherCode().- Overrides:
- isAssignableByOtherCodein class- JavaExpression
- Returns:
- true if some subexpression of this can be assigned to from outside the current method body
- See Also:
 
- 
isModifiableByOtherCodepublic boolean isModifiableByOtherCode()Description copied from class:JavaExpressionReturns true if the value this expression stands for can be changed by a method call; equivalently, if the value this expression evaluates to can be changed by a side effect from outside the containing method.Approximately, this returns true if the expression is JavaExpression.isAssignableByOtherCode()or its type is mutable. (Stringis an immutable type.)- Overrides:
- isModifiableByOtherCodein class- JavaExpression
- Returns:
- true if the value of this expression can be changed from outside the current method body
- See Also:
 
- 
acceptDescription copied from class:JavaExpressionAccept method of the visitor pattern.- Specified by:
- acceptin 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
 
 
-