Class UpperBoundAnnotatedTypeFactory.UpperBoundQualifierHierarchy

    • Method Detail

      • greatestLowerBoundQualifiers

        public javax.lang.model.element.AnnotationMirror greatestLowerBoundQualifiers​(javax.lang.model.element.AnnotationMirror a1,
                                                                                      javax.lang.model.element.AnnotationMirror a2)
        Description copied from class: QualifierHierarchy
        Returns the greatest lower bound for the qualifiers qualifier1 and qualifier2. Returns null if the qualifiers are not from the same qualifier hierarchy.
        Specified by:
        greatestLowerBoundQualifiers in class QualifierHierarchy
        Parameters:
        a1 - first qualifier
        a2 - second qualifier
        Returns:
        greatest lower bound of the two annotations, or null if the two annotations are not from the same hierarchy
      • leastUpperBoundQualifiers

        public javax.lang.model.element.AnnotationMirror leastUpperBoundQualifiers​(javax.lang.model.element.AnnotationMirror a1,
                                                                                   javax.lang.model.element.AnnotationMirror a2)
        Determines the least upper bound of a1 and a2. If a1 and a2 are both the same type of Value annotation, then the LUB is the result of taking the intersection of values from both a1 and a2.
        Specified by:
        leastUpperBoundQualifiers in class QualifierHierarchy
        Parameters:
        a1 - the first qualifier; may not be in the same hierarchy as qualifier2
        a2 - the second qualifier; may not be in the same hierarchy as qualifier1
        Returns:
        the least upper bound of a1 and a2
      • widenedUpperBound

        public javax.lang.model.element.AnnotationMirror widenedUpperBound​(javax.lang.model.element.AnnotationMirror newQualifier,
                                                                           javax.lang.model.element.AnnotationMirror previousQualifier)
        Description copied from class: QualifierHierarchy
        If the qualifier hierarchy has an infinite ascending chain, then the dataflow analysis might never reach a fixed point. To prevent this, implement this method such that it returns an upper bound for the two qualifiers that is a strict super type of the least upper bound. If this method is implemented, also override QualifierHierarchy.numberOfIterationsBeforeWidening() to return a positive number.

        newQualifier is newest qualifier dataflow computed for some expression and previousQualifier is the qualifier dataflow computed on the last iteration.

        If the qualifier hierarchy has no infinite ascending chain, returns the least upper bound of the two annotations.

        Overrides:
        widenedUpperBound in class QualifierHierarchy
        Parameters:
        newQualifier - new qualifier dataflow computed for some expression; must be in the same hierarchy as previousQualifier
        previousQualifier - the previous qualifier dataflow computed on the last iteration; must be in the same hierarchy as previousQualifier
        Returns:
        an upper bound that is higher than the least upper bound of newQualifier and previousQualifier (or the lub if the qualifier hierarchy does not require this)