T
- the type of the transfer functionpublic class InitializationTransfer<V extends CFAbstractValue<V>,T extends InitializationTransfer<V,T,S>,S extends InitializationStore<V,S>> extends CFAbstractTransfer<V,S,T>
CFAbstractTransfer
and tracks InitializationStore
s. In addition to the features of CFAbstractTransfer
, this transfer
function also track which fields of the current class ('self' receiver) have been initialized.
More precisely, the following refinements are performed:
InitializationStore.insertValue(FlowExpressions.Receiver, CFAbstractValue)
).
InitializationStore.insertValue(FlowExpressions.Receiver, CFAbstractValue)
).
InitializationStore
Modifier and Type | Field and Description |
---|---|
protected InitializationAnnotatedTypeFactory<?,?,?,?> |
atypeFactory |
analysis, sequentialSemantics
Constructor and Description |
---|
InitializationTransfer(CFAbstractAnalysis<V,S,T> analysis) |
Modifier and Type | Method and Description |
---|---|
protected List<VariableElement> |
initializedFieldsAfterCall(MethodInvocationNode node,
ConditionalTransferResult<V,S> transferResult)
Returns the fields that can safely be considered initialized after the method call
node . |
protected boolean |
isNotFullyInitializedReceiver(MethodTree methodTree)
Returns true if the receiver of a method might not yet be fully initialized.
|
protected void |
markInvariantFieldsAsInitialized(List<VariableElement> result,
TypeElement clazzElem)
Adds all the fields of the class
clazzElem that have the 'invariant annotation' to
the set of initialized fields result . |
TransferResult<V,S> |
visitAssignment(AssignmentNode n,
TransferInput<V,S> in) |
TransferResult<V,S> |
visitFieldAccess(FieldAccessNode n,
TransferInput<V,S> p)
If an invariant field is initialized and has the invariant annotation, than it has at least
the invariant annotation.
|
TransferResult<V,S> |
visitMethodInvocation(MethodInvocationNode n,
TransferInput<V,S> in) |
addInformationFromPreconditions, finishValue, finishValue, getTypeFactoryOfSubchecker, getValueFromFactory, getValueWithSameAnnotations, initialStore, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, processPostconditions, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitArrayAccess, visitCase, visitClassName, visitConditionalNot, visitEqualTo, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitObjectCreation, visitReturn, visitStringConcatenateAssignment, visitStringConversion, visitTernaryExpression, visitThisLiteral, visitVariableDeclaration, visitWideningConversion
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThisLiteral, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThisLiteral, visitInstanceOf, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThisLiteral, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThisLiteral, visitInstanceOf, 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
protected final InitializationAnnotatedTypeFactory<?,?,?,?> atypeFactory
public InitializationTransfer(CFAbstractAnalysis<V,S,T> analysis)
protected boolean isNotFullyInitializedReceiver(MethodTree methodTree)
CFAbstractTransfer
isNotFullyInitializedReceiver
in class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>,T extends InitializationTransfer<V,T,S>>
protected List<VariableElement> initializedFieldsAfterCall(MethodInvocationNode node, ConditionalTransferResult<V,S> transferResult)
node
.protected void markInvariantFieldsAsInitialized(List<VariableElement> result, TypeElement clazzElem)
clazzElem
that have the 'invariant annotation' to
the set of initialized fields result
.public TransferResult<V,S> visitAssignment(AssignmentNode n, TransferInput<V,S> in)
visitAssignment
in interface NodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>,TransferInput<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>>
visitAssignment
in class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>,T extends InitializationTransfer<V,T,S>>
public TransferResult<V,S> visitFieldAccess(FieldAccessNode n, TransferInput<V,S> p)
visitFieldAccess
in interface NodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>,TransferInput<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>>
visitFieldAccess
in class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>,T extends InitializationTransfer<V,T,S>>
public TransferResult<V,S> visitMethodInvocation(MethodInvocationNode n, TransferInput<V,S> in)
visitMethodInvocation
in interface NodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>,TransferInput<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>>>
visitMethodInvocation
in class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends InitializationStore<V,S>,T extends InitializationTransfer<V,T,S>>