Class MustCallTransfer
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.checker.mustcall.MustCallTransfer
- All Implemented Interfaces:
- ForwardTransferFunction<CFValue,,- CFStore> - TransferFunction<CFValue,,- CFStore> - NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
Transfer function for the must-call type system. Its primary purposes are (1) to create temporary
 variables for expressions (which allow those expressions to have refined information in the
 store, which the consistency checker can use), and (2) to reset refined information when a method
 annotated with @CreatesMustCallFor is called.
- 
Field SummaryFields inherited from class org.checkerframework.framework.flow.CFAbstractTransferanalysis, sequentialSemantics
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected @Nullable VariableTreecreateTemporaryVar(Node node) Creates a variable declaration for the given expression node, if possible.protected booleanChecks if WPI is enabled for the Resource Leak Checker inference.protected booleanprotected booleanshouldPerformWholeProgramInference(Tree expressionTree, Tree lhsTree) protected StringuniqueName(String prefix) Creates a unique, arbitrary string that can be used as a name for a temporary variable, using the given prefix.voidupdateStoreWithTempVar(TransferResult<CFValue, CFStore> result, Node node) This method either creates or looks up the temp var t for node, and then updates the store to give t the same type asnode.visitObjectCreation(ObjectCreationNode node, TransferInput<CFValue, CFStore> input) visitSwitchExpressionNode(SwitchExpressionNode node, TransferInput<CFValue, CFStore> input) visitTernaryExpression(TernaryExpressionNode node, TransferInput<CFValue, CFStore> input) Methods inherited from class org.checkerframework.framework.flow.CFAbstractTransferaddInformationFromPreconditions, createTransferResult, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getWidenedValue, initialStore, insertIntoStores, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, processPostconditions, recreateTransferResult, recreateTransferResult, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitArrayAccess, visitAssignment, visitCase, visitClassName, visitConditionalNot, visitDeconstructorPattern, visitEqualTo, visitExpressionStatement, visitFieldAccess, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitReturn, 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- 
MustCallTransferCreate a MustCallTransfer.- Parameters:
- analysis- the analysis
 
 
- 
- 
Method Details- 
visitStringConversionpublic TransferResult<CFValue,CFStore> visitStringConversion(StringConversionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
- visitStringConversionin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitStringConversionin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
visitMethodInvocationpublic TransferResult<CFValue,CFStore> visitMethodInvocation(MethodInvocationNode n, TransferInput<CFValue, CFStore> in) - Specified by:
- visitMethodInvocationin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitMethodInvocationin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
shouldPerformWholeProgramInference- Overrides:
- shouldPerformWholeProgramInferencein class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
- Parameters:
- tree- a tree
- Returns:
- false if Resource Leak Checker is running as one of the upstream checkers and the -AenableWpiForRlc flag is not passed as a command line argument, otherwise returns the result of the super call
 
- 
shouldPerformWholeProgramInference- Overrides:
- shouldPerformWholeProgramInferencein class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
- Parameters:
- expressionTree- a tree
- lhsTree- its element
- Returns:
- false if Resource Leak Checker is running as one of the upstream checkers and the -AenableWpiForRlc flag is not passed as a command line argument, otherwise returns the result of the super call
 
- 
visitObjectCreationpublic TransferResult<CFValue,CFStore> visitObjectCreation(ObjectCreationNode node, TransferInput<CFValue, CFStore> input) - Specified by:
- visitObjectCreationin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitObjectCreationin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
visitTernaryExpressionpublic TransferResult<CFValue,CFStore> visitTernaryExpression(TernaryExpressionNode node, TransferInput<CFValue, CFStore> input) - Specified by:
- visitTernaryExpressionin interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitTernaryExpressionin class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
visitSwitchExpressionNodepublic TransferResult<CFValue,CFStore> visitSwitchExpressionNode(SwitchExpressionNode node, TransferInput<CFValue, CFStore> input) - Specified by:
- visitSwitchExpressionNodein interface- NodeVisitor<TransferResult<CFValue,- CFStore>, - TransferInput<CFValue, - CFStore>> 
- Overrides:
- visitSwitchExpressionNodein class- CFAbstractTransfer<CFValue,- CFStore, - CFTransfer> 
 
- 
updateStoreWithTempVarThis method either creates or looks up the temp var t for node, and then updates the store to give t the same type asnode.- Parameters:
- node- the node to be assigned to a temporary variable
- result- the transfer result containing the store to be modified
 
- 
createTemporaryVarCreates a variable declaration for the given expression node, if possible.Note that error reporting code assumes that the names of temporary variables are not legal Java identifiers (see JLS 3.8). The temporary variable names generated here include an '-'character to make the names invalid.- Parameters:
- node- an expression node
- Returns:
- a variable tree for the node, or null if an appropriate containing element cannot be located
 
- 
uniqueNameCreates a unique, arbitrary string that can be used as a name for a temporary variable, using the given prefix. Can be used up to Long.MAX_VALUE times.Note that the correctness of the Resource Leak Checker depends on these names actually being unique, because LocalVariableNodes derived from them are used as keys in a map.- Parameters:
- prefix- the prefix for the name
- Returns:
- a unique name that starts with the prefix
 
- 
isWpiEnabledForRLCprotected boolean isWpiEnabledForRLC()Checks if WPI is enabled for the Resource Leak Checker inference. SeeResourceLeakChecker.ENABLE_WPI_FOR_RLC.- Returns:
- returns true if WPI is enabled for the Resource Leak Checker
 
 
-