Class DefaultInferredTypesApplier

java.lang.Object
org.checkerframework.framework.type.DefaultInferredTypesApplier

public class DefaultInferredTypesApplier extends Object
Utility class for applying the annotations inferred by dataflow to a given type.
  • Constructor Details

    • DefaultInferredTypesApplier

      public DefaultInferredTypesApplier(QualifierHierarchy hierarchy, AnnotatedTypeFactory atypeFactory)
      Creates an applier that applies an inferred qualifier only if it is a subtype of the qualifier it replaces.
      Parameters:
      hierarchy - the qualifier hierarchy of atypeFactory
      atypeFactory - the type factory that uses this applier
    • DefaultInferredTypesApplier

      public DefaultInferredTypesApplier(boolean omitSubtypingCheck, QualifierHierarchy hierarchy, AnnotatedTypeFactory atypeFactory)
      Creates an applier.
      Parameters:
      omitSubtypingCheck - whether to apply an inferred qualifier even if it is not a subtype of the qualifier it replaces
      hierarchy - the qualifier hierarchy of atypeFactory
      atypeFactory - the type factory that uses this applier
  • Method Details

    • applyInferredType

      public void applyInferredType(AnnotatedTypeMirror type, AnnotationMirrorSet inferredSet, TypeMirror inferredTypeMirror)
      For each top in qualifier hierarchy, traverse inferred and copy the required annotations over to type.
      Parameters:
      type - the type to which annotations are being applied
      inferredSet - the type inferred by data flow
      inferredTypeMirror - underlying inferred type