Search in sources :

Example 1 with D

use of org.checkerframework.framework.testchecker.lubglb.quals.D in project checker-framework by typetools.

the class LubGlbChecker method initChecker.

@Override
public void initChecker() {
    super.initChecker();
    Elements elements = processingEnv.getElementUtils();
    A = AnnotationBuilder.fromClass(elements, A.class);
    B = AnnotationBuilder.fromClass(elements, B.class);
    C = AnnotationBuilder.fromClass(elements, C.class);
    D = AnnotationBuilder.fromClass(elements, D.class);
    E = AnnotationBuilder.fromClass(elements, E.class);
    F = AnnotationBuilder.fromClass(elements, F.class);
    POLY = AnnotationBuilder.fromClass(elements, Poly.class);
    QualifierHierarchy qh = ((BaseTypeVisitor<?>) visitor).getTypeFactory().getQualifierHierarchy();
    // System.out.println("LUB of D and E: " + qh.leastUpperBound(D, E));
    assert AnnotationUtils.areSame(qh.leastUpperBound(D, E), C) : "LUB of D and E is not C!";
    // System.out.println("LUB of E and D: " + qh.leastUpperBound(E, D));
    assert AnnotationUtils.areSame(qh.leastUpperBound(E, D), C) : "LUB of E and D is not C!";
    // System.out.println("GLB of B and C: " + qh.greatestLowerBound(B, C));
    assert AnnotationUtils.areSame(qh.greatestLowerBound(B, C), D) : "GLB of B and C is not D!";
    // System.out.println("GLB of C and B: " + qh.greatestLowerBound(C, B));
    assert AnnotationUtils.areSame(qh.greatestLowerBound(C, B), D) : "GLB of C and B is not D!";
    assert AnnotationUtils.areSame(qh.greatestLowerBound(POLY, B), F) : "GLB of POLY and B is not F!";
    assert AnnotationUtils.areSame(qh.greatestLowerBound(POLY, F), F) : "GLB of POLY and F is not F!";
    assert AnnotationUtils.areSame(qh.greatestLowerBound(POLY, A), POLY) : "GLB of POLY and A is not POLY!";
    assert AnnotationUtils.areSame(qh.leastUpperBound(POLY, B), A) : "LUB of POLY and B is not A!";
    assert AnnotationUtils.areSame(qh.leastUpperBound(POLY, F), POLY) : "LUB of POLY and F is not POLY!";
    assert AnnotationUtils.areSame(qh.leastUpperBound(POLY, A), A) : "LUB of POLY and A is not A!";
}
Also used : A(org.checkerframework.framework.testchecker.lubglb.quals.A) B(org.checkerframework.framework.testchecker.lubglb.quals.B) C(org.checkerframework.framework.testchecker.lubglb.quals.C) D(org.checkerframework.framework.testchecker.lubglb.quals.D) E(org.checkerframework.framework.testchecker.lubglb.quals.E) F(org.checkerframework.framework.testchecker.lubglb.quals.F) QualifierHierarchy(org.checkerframework.framework.type.QualifierHierarchy) Poly(org.checkerframework.framework.testchecker.lubglb.quals.Poly) Elements(javax.lang.model.util.Elements)

Aggregations

Elements (javax.lang.model.util.Elements)1 A (org.checkerframework.framework.testchecker.lubglb.quals.A)1 B (org.checkerframework.framework.testchecker.lubglb.quals.B)1 C (org.checkerframework.framework.testchecker.lubglb.quals.C)1 D (org.checkerframework.framework.testchecker.lubglb.quals.D)1 E (org.checkerframework.framework.testchecker.lubglb.quals.E)1 F (org.checkerframework.framework.testchecker.lubglb.quals.F)1 Poly (org.checkerframework.framework.testchecker.lubglb.quals.Poly)1 QualifierHierarchy (org.checkerframework.framework.type.QualifierHierarchy)1