Class AnnotatedTypeCombiner
java.lang.Object
org.checkerframework.framework.type.visitor.AnnotatedTypeScanner<Void,AnnotatedTypeMirror>
org.checkerframework.framework.type.visitor.DoubleAnnotatedTypeScanner<Void>
org.checkerframework.framework.type.visitor.AnnotatedTypeCombiner
- All Implemented Interfaces:
AnnotatedTypeVisitor<Void,AnnotatedTypeMirror>
Changes each parameter type to be the GLB of the parameter type and visited type.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
AnnotatedTypeScanner.Reduce<R> -
Field Summary
Fields inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
defaultResult, reduceFunction, visitedNodes -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedTypeCombiner(QualifierHierarchy hierarchy) Create an AnnotatedTypeCombiner. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcombine(AnnotatedTypeMirror from, AnnotatedTypeMirror to, QualifierHierarchy hierarchy) Combines all annotations fromfromandtointotousing the GLB.protected voidComputes the greatest lower bound of each set of annotations shared by from and to, and replaces the annotations in to with the result.protected VoidCalled by default for any visit method that is not overridden.Methods inherited from class org.checkerframework.framework.type.visitor.DoubleAnnotatedTypeScanner
scan, scan, scanAndReduce, scanAndReduce, visitArray, visitDeclared, visitExecutable, visitIntersection, visitTypeVariable, visitUnion, visitWildcardMethods inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
reduce, reset, scan, scanAndReduce, visit, visit, visitNoType, visitNull, visitPrimitive
-
Constructor Details
-
AnnotatedTypeCombiner
Create an AnnotatedTypeCombiner.- Parameters:
hierarchy- the hierarchy used to the compute the GLB
-
-
Method Details
-
combine
public static void combine(AnnotatedTypeMirror from, AnnotatedTypeMirror to, QualifierHierarchy hierarchy) Combines all annotations fromfromandtointotousing the GLB.- Parameters:
from- the annotated type mirror from which to take annotationsto- the annotated type mirror into which annotations should be combinedhierarchy- the top type of the hierarchy whose annotations should be combined
-
defaultAction
Description copied from class:DoubleAnnotatedTypeScannerCalled by default for any visit method that is not overridden.- Specified by:
defaultActionin classDoubleAnnotatedTypeScanner<Void>- Parameters:
one- the type to visittwo- a visitor-specified parameter- Returns:
- a visitor-specified result
-
combineAnnotations
Computes the greatest lower bound of each set of annotations shared by from and to, and replaces the annotations in to with the result.- Parameters:
from- the first set of annotationsto- the second set of annotations. This is modified by side-effect to hold the result.
-