publishedApiAnnotation

fun KtDeclaration.publishedApiAnnotation(): KtAnnotationEntry?

matching on the shortName is valid, as the diagnostic is only applied, if the FqName correlates. Which is checked prior to the Diagnostic being applied.