Class ResourceLeakVisitor
java.lang.Object
com.sun.source.util.TreeScanner<R,P>
 
com.sun.source.util.TreePathScanner<R,P>
 
org.checkerframework.framework.source.SourceVisitor<Void,Void>
 
org.checkerframework.common.basetype.BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
org.checkerframework.common.accumulation.AccumulationVisitor
org.checkerframework.checker.calledmethods.CalledMethodsVisitor
org.checkerframework.checker.resourceleak.ResourceLeakVisitor
- All Implemented Interfaces:
- TreeVisitor<Void,- Void> 
The visitor for the Resource Leak Checker. Responsible for checking that the rules for 
Owning fields are satisfied, and for checking that CreatesMustCallFor overrides are
 valid.- 
Nested Class SummaryNested classes/interfaces inherited from class org.checkerframework.common.basetype.BaseTypeVisitorBaseTypeVisitor.OverrideChecker
- 
Field SummaryFields inherited from class org.checkerframework.common.basetype.BaseTypeVisitorassumePureGetters, atypeFactory, checker, DETERMINISTIC, IMPURE, methodTree, positions, PURE, qualHierarchy, showchecks, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeHierarchy, typeValidator, unusedWhenElement, warnRedundantAnnotationsFields inherited from class org.checkerframework.framework.source.SourceVisitorelements, root, trees, treesWithSuppressWarnings, types
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ResourceLeakAnnotatedTypeFactoryConstructs an instance of the appropriate type factory for the implemented type system.protected booleanChecks if WPI is enabled for the Resource Leak Checker inference.voidprocessMethodTree(String className, MethodTree tree) Type-check methodTree.protected booleanShould Whole Program Inference attempt to infer contract annotations? Typically, the answer is "yes" whenever WPI is enabled, but this method exists to allow subclasses to customize that behavior.visitVariable(VariableTree tree, Void p) Methods inherited from class org.checkerframework.checker.calledmethods.CalledMethodsVisitorcheckExceptionalPostcondition, reportMethodInvocabilityError, visitAnnotation, visitMethodInvocationMethods inherited from class org.checkerframework.common.basetype.BaseTypeVisitorcheckAccess, checkAccessAllowed, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, checkConstructorResult, checkContract, checkDefaultConstructor, checkExceptionParameter, checkExplicitAnnotationsOnIntersectionBounds, checkExtendsAndImplements, checkExtendsOrImplements, checkFieldInvariantDeclarations, checkMethodInvocability, checkMethodReferenceAsOverride, checkOverride, checkOverride, checkPostcondition, checkPreconditions, checkPurityAnnotations, checkQualifierParameter, checkSuperConstructorCall, checkThisConstructorCall, checkThisOrSuperConstructorCall, checkThrownExpression, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, checkVarargs, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckStartDiagnostic, contractExpressionAndType, createOverrideChecker, createTypeFactoryPublic, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isTypeCastSafe, isValidUse, isValidUse, isValidUse, processClassTree, reportPurityErrors, scan, setRoot, shouldSkipUses, shouldWarnAboutIrrelevantJavaTypes, skipReceiverSubtypeCheck, testAnnotationInsertion, testJointJavacJavaParserVisitor, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotatedType, visitAnnotatedType, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethod, visitNewArray, visitNewClass, visitReturn, visitSwitchExpression17, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, warnAboutIrrelevantJavaTypes, warnInvalidPolymorphicQualifier, warnInvalidPolymorphicQualifier, warnRedundantAnnotationsMethods inherited from class org.checkerframework.framework.source.SourceVisitorvisitMethods inherited from class com.sun.source.util.TreePathScannergetCurrentPath, scanMethods inherited from class com.sun.source.util.TreeScannerreduce, scan, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSwitchExpression, visitSynchronized, visitTry, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield
- 
Constructor Details- 
ResourceLeakVisitorCreate the visitor.- Parameters:
- checker- the type-checker associated with this visitor
 
 
- 
- 
Method Details- 
createTypeFactoryDescription copied from class:BaseTypeVisitorConstructs an instance of the appropriate type factory for the implemented type system.The default implementation uses the checker naming convention to create the appropriate type factory. If no factory is found, it returns BaseAnnotatedTypeFactory. It reflectively invokes the constructor that accepts this checker and compilation unit tree (in that order) as arguments.Subclasses have to override this method to create the appropriate visitor if they do not follow the checker naming convention. - Overrides:
- createTypeFactoryin class- BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
- Returns:
- the appropriate type factory
 
- 
processMethodTreeDescription copied from class:BaseTypeVisitorType-check methodTree. Subclasses should override this method instead ofBaseTypeVisitor.visitMethod(MethodTree, Void).- Overrides:
- processMethodTreein class- CalledMethodsVisitor
- Parameters:
- className- the class that contains the method, for diagnostics only
- tree- the method to type-check
 
- 
shouldPerformContractInferenceprotected boolean shouldPerformContractInference()Description copied from class:BaseTypeVisitorShould Whole Program Inference attempt to infer contract annotations? Typically, the answer is "yes" whenever WPI is enabled, but this method exists to allow subclasses to customize that behavior.- Overrides:
- shouldPerformContractInferencein class- BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
- Returns:
- true if contract inference should be performed, false if it should be disabled (even when WPI is enabled)
 
- 
visitVariable- Specified by:
- visitVariablein interface- TreeVisitor<Void,- Void> 
- Overrides:
- visitVariablein class- BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
 
- 
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
 
 
-