Class AnnotatedTypeCombiner
java.lang.Object
org.checkerframework.framework.type.visitor.AnnotatedTypeScanner<R,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
ConstructorDescriptionAnnotatedTypeCombiner
(QualifierHierarchy hierarchy) Create an AnnotatedTypeCombiner. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
combine
(AnnotatedTypeMirror from, AnnotatedTypeMirror to, QualifierHierarchy hierarchy) Combines all annotations fromfrom
andto
intoto
using the GLB.protected void
Computes the greatest lower bound of each set of annotations shared by from and to, and replaces the annotations in to with the result.protected Void
Called 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, visitWildcard
Methods 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 fromfrom
andto
intoto
using 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:DoubleAnnotatedTypeScanner
Called by default for any visit method that is not overridden.- Specified by:
defaultAction
in 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.
-