Class AliasingTransfer
java.lang.Object
org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor<TransferResult<V,S>,TransferInput<V,S>>
   
org.checkerframework.framework.flow.CFAbstractTransfer<CFValue,CFStore,CFTransfer>
  
org.checkerframework.framework.flow.CFTransfer
org.checkerframework.common.aliasing.AliasingTransfer
- All Implemented Interfaces:
- ForwardTransferFunction<CFValue,,- CFStore> - TransferFunction<CFValue,,- CFStore> - NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
Type refinement is treated in the usual way, except that at (pseudo-)assignments the RHS may lose
 its type refinement, before the LHS is type-refined.
 
The RHS always loses its type refinement (it is widened to @MaybeAliased, and its declared type must have been @MaybeAliased) except in the following cases:
- The RHS is a fresh expression.
- The LHS is a @NonLeaked formal parameter and the RHS is an argument in a method call or constructor invocation.
- The LHS is a @LeakedToResult formal parameter, the RHS is an argument in a method call or constructor invocation, and the method's return value is discarded.
- 
Field SummaryFields inherited from class org.checkerframework.framework.flow.CFAbstractTransferanalysis, sequentialSemantics
- 
Constructor SummaryConstructorsConstructorDescriptionAliasingTransfer(CFAbstractAnalysis<CFValue, CFStore, CFTransfer> analysis) Create a new AliasingTransfer.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidprocessPostconditions(Node n, CFStore store, ExecutableElement executableElement, ExpressionTree tree) Handling pseudo-assignments.Case 1: For every assignment, the LHS is refined if the RHS has type @Unique and is a method invocation or a new class instance.Case 3: Given a method invocation expression, if the parent of the expression is not a statement, check if there are any arguments of the method call annotated as @LeakedToResult and remove it from the store, since it might be leaked.Methods inherited from class org.checkerframework.framework.flow.CFAbstractTransferaddInformationFromPreconditions, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getWidenedValue, initialStore, insertIntoStores, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, recreateTransferResult, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitArrayAccess, visitCase, visitClassName, visitConditionalNot, visitEqualTo, visitExpressionStatement, visitFieldAccess, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitObjectCreation, visitReturn, visitStringConversion, visitSwitchExpressionNode, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversionMethods inherited from class org.checkerframework.dataflow.cfg.node.AbstractNodeVisitorvisitArrayCreation, 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, visitValueLiteralMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.cfg.node.NodeVisitorvisitArrayCreation, 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
- 
Constructor Details- 
AliasingTransferCreate a new AliasingTransfer.- Parameters:
- analysis- the CFAbstractAnalysis
 
 
- 
- 
Method Details- 
visitAssignmentpublic TransferResult<CFValue,CFStore> visitAssignment(AssignmentNode n, TransferInput<CFValue, CFStore> in) Case 1: For every assignment, the LHS is refined if the RHS has type @Unique and is a method invocation or a new class instance.- Specified by:
- visitAssignmentin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitAssignmentin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
processPostconditionsprotected void processPostconditions(Node n, CFStore store, ExecutableElement executableElement, ExpressionTree tree) Handling pseudo-assignments. Called byCFAbstractTransfer.visitMethodInvocation().Case 2: Given a method call, traverses all formal parameters of the method declaration, and if it doesn't have the @NonLeaked or @LeakedToResult annotations, we remove the node of the respective argument in the method call from the store. If parameter has @LeakedToResult, visitMethodInvocation()handles it.- Overrides:
- processPostconditionsin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
- Parameters:
- n- a method call or an object creation
- store- a store; is side-effected by this method
- executableElement- the method or constructor being called
- tree- the tree for the method call or the object creation
 
- 
visitMethodInvocationpublic TransferResult<CFValue,CFStore> visitMethodInvocation(MethodInvocationNode n, TransferInput<CFValue, CFStore> in) Case 3: Given a method invocation expression, if the parent of the expression is not a statement, check if there are any arguments of the method call annotated as @LeakedToResult and remove it from the store, since it might be leaked.- Specified by:
- visitMethodInvocationin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitMethodInvocationin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
 
-