in src/main/java/com/amazon/checkerframework/checker/data_classification/DataClassificationVisitor.java [293:313]
protected boolean skipReceiverSubtypeCheck(
final MethodInvocationTree node,
final AnnotatedTypeMirror methodDefinitionReceiver,
final AnnotatedTypeMirror methodCallReceiver) {
ExecutableElement definition = TreeUtils.elementFromUse(node);
Element enclosingClass = ElementUtils.enclosingClass(definition);
AnnotatedTypeMirror classType = atypeFactory.getAnnotatedType(enclosingClass);
AnnotationMirror classAnno =
classType.getAnnotationInHierarchy(atypeFactory.getCanonicalPublicAnnotation());
AnnotationMirror methodCallReceiverAnno =
methodCallReceiver.getAnnotationInHierarchy(
atypeFactory.getCanonicalPublicAnnotation());
// if either is null, default to conservatively not skipping the check
if (methodCallReceiverAnno == null || classAnno == null) {
return false;
}
return atypeFactory.getQualifierHierarchy().isSubtype(methodCallReceiverAnno, classAnno);
}