Class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>>
- All Implemented Interfaces:
ForwardTransferFunction<V,
,S> TransferFunction<V,
,S> NodeVisitor<TransferResult<V,
S>, TransferInput<V, S>>
- Direct Known Subclasses:
AccumulationTransfer
,CFTransfer
,InitializationTransfer
,KeyForTransfer
,LockTransfer
AnnotatedTypeFactory
to provide checker-specific logic how to
combine types (e.g., what is the type of a string concatenation, given the types of the two
operands) and as an abstraction function (e.g., determine the annotations on literals).
Design note: CFAbstractTransfer and its subclasses are supposed to act as transfer functions. But, since the AnnotatedTypeFactory already existed and performed checker-independent type propagation, CFAbstractTransfer delegates work to it instead of duplicating some logic in CFAbstractTransfer. The checker-specific subclasses of CFAbstractTransfer do implement transfer function logic themselves.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CFAbstractAnalysis<V,
S, T> The analysis used by this transfer function.protected final boolean
Should the analysis use sequential Java semantics (i.e., assume that only one thread is running at all times)? -
Constructor Summary
ModifierConstructorDescriptionprotected
CFAbstractTransfer
(CFAbstractAnalysis<V, S, T> analysis) Create a CFAbstractTransfer.protected
CFAbstractTransfer
(CFAbstractAnalysis<V, S, T> analysis, boolean forceConcurrentSemantics) Constructor that allows forcing concurrent semantics to be on for this instance of CFAbstractTransfer. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addInformationFromPreconditions
(S initialStore, AnnotatedTypeFactory factory, UnderlyingAST.CFGMethod methodAst, MethodTree methodDeclTree, ExecutableElement methodElement) Add the information from all the preconditions of a method to the initial store in the method body.protected TransferResult<V,
S> createTransferResult
(@Nullable V value, TransferInput<V, S> in) Creates a TransferResult.finishValue
(@Nullable V value, S store) A hook for subclasses to modify the result of the transfer function.finishValue
(@Nullable V value, S thenStore, S elseStore) A hook for subclasses to modify the result of the transfer function.getNarrowedValue
(TypeMirror type, @PolyNull V annotatedValue) Returns an abstract value with the giventype
and the annotations fromannotatedValue
, adapted for narrowing.protected V
getValueFromFactory
(Tree tree, Node node) Returns the abstract value of a non-leaf treetree
, as computed by theAnnotatedTypeFactory
.getWidenedValue
(TypeMirror type, @PolyNull V annotatedValue) Returns an abstract value with the giventype
and the annotations fromannotatedValue
, adapted for widening.initialStore
(UnderlyingAST underlyingAST, List<LocalVariableNode> parameters) The initial store maps method formal parameters to their currently most refined type.protected static void
insertIntoStores
(TransferResult<CFValue, CFStore> result, JavaExpression target, AnnotationMirror newAnno) Inserts newAnno as the value into all stores (conditional or not) in the result for node.protected boolean
isNotFullyInitializedReceiver
(MethodTree methodDeclTree) Returns true if the receiver of a method or constructor might not yet be fully initialized.moreSpecificValue
(V value1, V value2) Returns the abstract value of(value1, value2)
that is more specific.protected void
processCommonAssignment
(TransferInput<V, S> in, Node lhs, Node rhs, S store, V rhsValue) Determine abstract value of right-hand side and update the store accordingly.protected void
processConditionalPostconditions
(MethodInvocationNode invocationNode, ExecutableElement methodElement, ExpressionTree invocationTree, S thenStore, S elseStore) Add information from the conditional postconditions of a method to the stores after an invocation.protected void
processPostconditions
(Node invocationNode, S store, ExecutableElement executableElement, ExpressionTree invocationTree) Add information from the postconditions of a method to the store after an invocation.protected TransferResult<V,
S> recreateTransferResult
(@Nullable V value, TransferResult<V, S> in) Creates a TransferResult just like the given one, but with the given value.void
Set a fixed initial Store.splitAssignments
(Node node) Takes a node, and either returns the node itself again (as a singleton list), or if the node is an assignment node, returns the lhs and rhs (where splitAssignments is applied recursively to the rhs -- that is, it is possible that the rhs does not appear in the result, but rather its lhs and rhs do).protected TransferResult<V,
S> strengthenAnnotationOfEqualTo
(TransferResult<V, S> res, Node firstNode, Node secondNode, V firstValue, V secondValue, boolean notEqualTo) Refine the annotation ofsecondNode
if the annotationsecondValue
is less precise thanfirstValue
.boolean
Returns true if the transfer function uses sequential semantics, false if it uses concurrent semantics.visitAssignment
(AssignmentNode n, TransferInput<V, S> in) visitCase
(CaseNode n, TransferInput<V, S> in) A case produces no value, but it may imply some facts about switch selector expression.visitClassName
(ClassNameNode n, TransferInput<V, S> in) Reverse the role of the 'thenStore' and 'elseStore'.visitEqualTo
(EqualToNode n, TransferInput<V, S> p) visitExpressionStatement
(ExpressionStatementNode n, TransferInput<V, S> vsTransferInput) Visits an expression that is used as a statement.visitInstanceOf
(InstanceOfNode node, TransferInput<V, S> in) Use the most specific type information available according to the store.visitNode
(Node n, TransferInput<V, S> in) The default visitor returns the input information unchanged, or in the case of conditional input information, merged.visitNotEqual
(NotEqualNode n, TransferInput<V, S> p) visitReturn
(ReturnNode n, TransferInput<V, S> p) visitSwitchExpressionNode
(SwitchExpressionNode n, TransferInput<V, S> vsTransferInput) visitThis
(ThisNode n, TransferInput<V, S> in) Methods inherited from class org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDeconstructorPattern, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift, visitValueLiteral
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.checkerframework.dataflow.cfg.node.NodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDeconstructorPattern, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift
-
Field Details
-
analysis
protected final CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, analysisS>, T extends CFAbstractTransfer<V, S, T>> The analysis used by this transfer function. -
sequentialSemantics
protected final boolean sequentialSemanticsShould the analysis use sequential Java semantics (i.e., assume that only one thread is running at all times)?
-
-
Constructor Details
-
CFAbstractTransfer
Create a CFAbstractTransfer.- Parameters:
analysis
- the analysis used by this transfer function
-
CFAbstractTransfer
Constructor that allows forcing concurrent semantics to be on for this instance of CFAbstractTransfer.- Parameters:
analysis
- the analysis used by this transfer functionforceConcurrentSemantics
- whether concurrent semantics should be forced to be on. If false, concurrent semantics are turned off by default, but the user can still turn them on via-AconcurrentSemantics
. If true, the user cannot turn off concurrent semantics.
-
-
Method Details
-
usesSequentialSemantics
Returns true if the transfer function uses sequential semantics, false if it uses concurrent semantics. Useful when creating an empty store, since a store makes different decisions depending on whether sequential or concurrent semantics are used.- Returns:
- true if the transfer function uses sequential semantics, false if it uses concurrent semantics
-
finishValue
A hook for subclasses to modify the result of the transfer function. This method is called before returning the abstract valuevalue
as the result of the transfer function.If a subclass overrides this method, the subclass should also override
finishValue(CFAbstractValue,CFAbstractStore,CFAbstractStore)
.- Parameters:
value
- a value to possibly modifystore
- the store- Returns:
- the possibly-modified value
-
finishValue
A hook for subclasses to modify the result of the transfer function. This method is called before returning the abstract valuevalue
as the result of the transfer function.If a subclass overrides this method, the subclass should also override
finishValue(CFAbstractValue,CFAbstractStore)
.- Parameters:
value
- the value to finishthenStore
- the "then" storeelseStore
- the "else" store- Returns:
- the possibly-modified value
-
getValueFromFactory
Returns the abstract value of a non-leaf treetree
, as computed by theAnnotatedTypeFactory
.- Returns:
- the abstract value of a non-leaf tree
tree
, as computed by theAnnotatedTypeFactory
-
setFixedInitialStore
Set a fixed initial Store.- Parameters:
s
- initial store; possible null
-
initialStore
The initial store maps method formal parameters to their currently most refined type.- Specified by:
initialStore
in interfaceForwardTransferFunction<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Parameters:
underlyingAST
- an abstract syntax treeparameters
- a list of local variable nodes representing formal parameters (if any)- Returns:
- the initial store
-
isNotFullyInitializedReceiver
Returns true if the receiver of a method or constructor might not yet be fully initialized.- Parameters:
methodDeclTree
- the declaration of the method or constructor- Returns:
- true if the receiver of a method or constructor might not yet be fully initialized
-
addInformationFromPreconditions
protected void addInformationFromPreconditions(S initialStore, AnnotatedTypeFactory factory, UnderlyingAST.CFGMethod methodAst, MethodTree methodDeclTree, ExecutableElement methodElement) Add the information from all the preconditions of a method to the initial store in the method body.- Parameters:
initialStore
- the initial store for the method bodyfactory
- the type factorymethodAst
- the AST for a method declarationmethodDeclTree
- the declaration of the method; is a field ofmethodAst
methodElement
- the element for the method
-
visitNode
The default visitor returns the input information unchanged, or in the case of conditional input information, merged.- Specified by:
visitNode
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
createTransferResult
@SideEffectFree protected TransferResult<V,S> createTransferResult(@Nullable V value, TransferInput<V, S> in) Creates a TransferResult.This default implementation returns the input information unchanged, or in the case of conditional input information, merged.
- Parameters:
value
- the value; possibly nullin
- the transfer input- Returns:
- the input information, as a TransferResult
-
recreateTransferResult
@SideEffectFree protected TransferResult<V,S> recreateTransferResult(@Nullable V value, TransferResult<V, S> in) Creates a TransferResult just like the given one, but with the given value.This default implementation returns the input information unchanged, or in the case of conditional input information, merged.
- Parameters:
value
- the value; possibly nullin
- the TransferResult to copy- Returns:
- the input informatio
-
visitClassName
- Specified by:
visitClassName
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitClassName
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitFieldAccess
- Specified by:
visitFieldAccess
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitFieldAccess
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitArrayAccess
- Specified by:
visitArrayAccess
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitArrayAccess
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitLocalVariable
Use the most specific type information available according to the store.- Specified by:
visitLocalVariable
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitLocalVariable
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitThis
- Overrides:
visitThis
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitTernaryExpression
- Specified by:
visitTernaryExpression
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitTernaryExpression
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitSwitchExpressionNode
public TransferResult<V,S> visitSwitchExpressionNode(SwitchExpressionNode n, TransferInput<V, S> vsTransferInput) - Specified by:
visitSwitchExpressionNode
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitSwitchExpressionNode
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitConditionalNot
Reverse the role of the 'thenStore' and 'elseStore'.- Specified by:
visitConditionalNot
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitConditionalNot
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitEqualTo
- Specified by:
visitEqualTo
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitEqualTo
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitNotEqual
- Specified by:
visitNotEqual
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitNotEqual
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
strengthenAnnotationOfEqualTo
protected TransferResult<V,S> strengthenAnnotationOfEqualTo(TransferResult<V, S> res, Node firstNode, Node secondNode, V firstValue, V secondValue, boolean notEqualTo) Refine the annotation ofsecondNode
if the annotationsecondValue
is less precise thanfirstValue
. This is possible, ifsecondNode
is an expression that is tracked by the store (e.g., a local variable or a field). Clients usually call this twice withfirstNode
andsecondNode
reversed, to refine each of them.Note that when overriding this method, when a new type is inserted into the store,
splitAssignments(org.checkerframework.dataflow.cfg.node.Node)
should be called, and the new type should be inserted into the store for each of the resulting nodes.- Parameters:
firstNode
- the node that might be more precisesecondNode
- the node whose type to possibly refinefirstValue
- the abstract value that might be more precisesecondValue
- the abstract value that might be less preciseres
- the previous resultnotEqualTo
- if true, indicates that the logic is flipped (i.e., the information is added to theelseStore
instead of thethenStore
) for a not-equal comparison.- Returns:
- the conditional transfer result (if information has been added), or
res
-
splitAssignments
Takes a node, and either returns the node itself again (as a singleton list), or if the node is an assignment node, returns the lhs and rhs (where splitAssignments is applied recursively to the rhs -- that is, it is possible that the rhs does not appear in the result, but rather its lhs and rhs do).- Parameters:
node
- possibly an assignment node- Returns:
- a list containing all the right- and left-hand sides in the given assignment node; it contains just the node itself if it is not an assignment)
-
visitAssignment
- Specified by:
visitAssignment
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitAssignment
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitReturn
- Specified by:
visitReturn
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitReturn
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitLambdaResultExpression
public TransferResult<V,S> visitLambdaResultExpression(LambdaResultExpressionNode n, TransferInput<V, S> in) - Specified by:
visitLambdaResultExpression
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitLambdaResultExpression
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
processCommonAssignment
protected void processCommonAssignment(TransferInput<V, S> in, Node lhs, Node rhs, S store, V rhsValue) Determine abstract value of right-hand side and update the store accordingly.- Parameters:
in
- the store(s) before the assignmentlhs
- the left-hand side of the assignmentrhs
- the right-hand side of the assignmentstore
- the regular input store (fromin
)rhsValue
- the value of the right-hand side of the assignment
-
visitObjectCreation
- Specified by:
visitObjectCreation
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitObjectCreation
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitMethodInvocation
- Specified by:
visitMethodInvocation
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitMethodInvocation
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitInstanceOf
- Specified by:
visitInstanceOf
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitInstanceOf
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
processPostconditions
protected void processPostconditions(Node invocationNode, S store, ExecutableElement executableElement, ExpressionTree invocationTree) Add information from the postconditions of a method to the store after an invocation.- Parameters:
invocationNode
- a method call or an object creationstore
- a store; is side-effected by this methodexecutableElement
- the method or constructor being calledinvocationTree
- the tree for the method call or the object creation
-
processConditionalPostconditions
protected void processConditionalPostconditions(MethodInvocationNode invocationNode, ExecutableElement methodElement, ExpressionTree invocationTree, S thenStore, S elseStore) Add information from the conditional postconditions of a method to the stores after an invocation.- Parameters:
invocationNode
- a method callmethodElement
- the method being calledinvocationTree
- the tree for the method callthenStore
- the "then" store; is side-effected by this methodelseStore
- the "else" store; is side-effected by this method
-
visitCase
A case produces no value, but it may imply some facts about switch selector expression.- Specified by:
visitCase
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitCase
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
moreSpecificValue
Returns the abstract value of(value1, value2)
that is more specific. If the two are incomparable, thenvalue1
is returned.- Parameters:
value1
- an abstract valuevalue2
- another abstract value- Returns:
- the more specific value of the two parameters, or, if they are incomparable,
value1
-
visitVariableDeclaration
public TransferResult<V,S> visitVariableDeclaration(VariableDeclarationNode n, TransferInput<V, S> p) - Specified by:
visitVariableDeclaration
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitVariableDeclaration
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitWideningConversion
- Specified by:
visitWideningConversion
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitWideningConversion
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
getNarrowedValue
Returns an abstract value with the giventype
and the annotations fromannotatedValue
, adapted for narrowing. This is only called at a narrowing conversion.- Parameters:
type
- the type to narrow toannotatedValue
- the type to narrow from- Returns:
- an abstract value with the given
type
and the annotations fromannotatedValue
; returns null ifannotatedValue
is null
-
getWidenedValue
Returns an abstract value with the giventype
and the annotations fromannotatedValue
, adapted for widening. This is only called at a widening conversion.- Parameters:
type
- the type to widen toannotatedValue
- the type to widen from- Returns:
- an abstract value with the given
type
and the annotations fromannotatedValue
; returns null ifannotatedValue
is null
-
visitNarrowingConversion
public TransferResult<V,S> visitNarrowingConversion(NarrowingConversionNode n, TransferInput<V, S> p) - Specified by:
visitNarrowingConversion
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitNarrowingConversion
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitStringConversion
- Specified by:
visitStringConversion
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitStringConversion
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitExpressionStatement
public TransferResult<V,S> visitExpressionStatement(ExpressionStatementNode n, TransferInput<V, S> vsTransferInput) Description copied from interface:NodeVisitor
Visits an expression that is used as a statement. This node is a marker after the expression node(s).- Specified by:
visitExpressionStatement
in interfaceNodeVisitor<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>> - Overrides:
visitExpressionStatement
in classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,
S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>> - Parameters:
n
- theExpressionStatementNode
to be visitedvsTransferInput
- the argument for the operation implemented by this visitor- Returns:
- the return value of the operation implemented by this visitor
-
insertIntoStores
protected static void insertIntoStores(TransferResult<CFValue, CFStore> result, JavaExpression target, AnnotationMirror newAnno) Inserts newAnno as the value into all stores (conditional or not) in the result for node. This is a utility method for subclasses.- Parameters:
result
- the TransferResult holding the stores to modifytarget
- the receiver whose value should be modifiednewAnno
- the new value
-