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 tracks which fields of the current class ('self' receiver) have been initialized.
More precisely, the following refinements are performed:
CFAbstractStore.insertValue(JavaExpression, CFAbstractValue)
).
CFAbstractStore.insertValue(JavaExpression, 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)
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 or constructor 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, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getValueWithSameAnnotations, getWidenedValue, initialStore, insertIntoStores, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, processPostconditions, recreateTransferResult, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitArrayAccess, visitCase, visitClassName, visitConditionalNot, visitEqualTo, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitObjectCreation, visitReturn, visitStringConcatenateAssignment, visitStringConversion, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversion
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, 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
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>>
methodTree
- the declaration of the method or constructorprotected List<VariableElement> initializedFieldsAfterCall(MethodInvocationNode node)
node
.node
- a method callprotected 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>>