Class CFAbstractValue.ValueLub
- java.lang.Object
-
- org.checkerframework.framework.flow.CFAbstractValue.AnnotationSetCombiner
-
- org.checkerframework.framework.flow.CFAbstractValue.ValueLub
-
- Enclosing class:
- CFAbstractValue<V extends CFAbstractValue<V>>
protected class CFAbstractValue.ValueLub extends CFAbstractValue.AnnotationSetCombiner
Computes the least upper bound or, ifshouldWiden
is true, an upper bounds of two sets of annotations. The computation accounts for sets that are missing annotations in hierarchies.
-
-
Constructor Summary
Constructors Constructor Description ValueLub(boolean shouldWiden)
Creates aCFAbstractValue.ValueLub
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @Nullable javax.lang.model.element.AnnotationMirror
combineAnnotationWithTypeVar(javax.lang.model.element.AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Returns the result of combiningannotation
withtypeVar
.protected @Nullable javax.lang.model.element.AnnotationMirror
combineTwoAnnotations(javax.lang.model.element.AnnotationMirror a, javax.lang.model.type.TypeMirror aTypeMirror, javax.lang.model.element.AnnotationMirror b, javax.lang.model.type.TypeMirror bTypeMirror, javax.lang.model.element.AnnotationMirror top)
Returns the result of combining the two annotations.protected @Nullable javax.lang.model.element.AnnotationMirror
combineTwoTypeVars(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable
.-
Methods inherited from class org.checkerframework.framework.flow.CFAbstractValue.AnnotationSetCombiner
combineSets
-
-
-
-
Constructor Detail
-
ValueLub
public ValueLub(boolean shouldWiden)
Creates aCFAbstractValue.ValueLub
.- Parameters:
shouldWiden
- if true, this class computes an upper bound
-
-
Method Detail
-
combineTwoAnnotations
protected @Nullable javax.lang.model.element.AnnotationMirror combineTwoAnnotations(javax.lang.model.element.AnnotationMirror a, javax.lang.model.type.TypeMirror aTypeMirror, javax.lang.model.element.AnnotationMirror b, javax.lang.model.type.TypeMirror bTypeMirror, javax.lang.model.element.AnnotationMirror top)
Description copied from class:CFAbstractValue.AnnotationSetCombiner
Returns the result of combining the two annotations. This method is called when an annotation exists in both sets for the hierarchy whose top istop
.- Specified by:
combineTwoAnnotations
in classCFAbstractValue.AnnotationSetCombiner
- Parameters:
a
- an annotation in the hierarchyaTypeMirror
- the type that is annotated bya
b
- an annotation in the hierarchybTypeMirror
- the type that is annotated byb
top
- the top annotation in the hierarchy- Returns:
- the result of combining the two annotations or null if no combination exists
-
combineTwoTypeVars
protected @Nullable javax.lang.model.element.AnnotationMirror combineTwoTypeVars(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Description copied from class:CFAbstractValue.AnnotationSetCombiner
Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable
. If the result has no primary annotation,null
is returned. This method is called when no annotation exists in either sets for the hierarchy whose top istop
.- Specified by:
combineTwoTypeVars
in classCFAbstractValue.AnnotationSetCombiner
- Parameters:
aAtv
- a type variable that does not have a primary annotation intop
hierarchybAtv
- a type variable that does not have a primary annotation intop
hierarchytop
- the top annotation in the hierarchycanCombinedSetBeMissingAnnos
- whether or not- Returns:
- the result of combining the two type variables, which may be null
-
combineAnnotationWithTypeVar
protected @Nullable javax.lang.model.element.AnnotationMirror combineAnnotationWithTypeVar(javax.lang.model.element.AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Description copied from class:CFAbstractValue.AnnotationSetCombiner
Returns the result of combiningannotation
withtypeVar
.This is called when an annotation exists for the hierarchy in one set, but not the other.
- Specified by:
combineAnnotationWithTypeVar
in classCFAbstractValue.AnnotationSetCombiner
- Parameters:
annotation
- an annotationtypeVar
- a type variable that does not have a primary annotation in the hierarchytop
- the top annotation of the hierarchycanCombinedSetBeMissingAnnos
- whether or not- Returns:
- the result of combining
annotation
withtypeVar
-
-