if (!(value instanceof AnnotationData)) {
logger.log(TreeLogger.WARN, "Annotation error: expected annotation type "
+ expectedType.getCanonicalName() + ", got " + value.getClass().getCanonicalName());
return null;
}
AnnotationData annotData = (AnnotationData) value;
Class<? extends Annotation> annotationClass = getAnnotationClass(logger, annotData);
if (!expectedType.isAssignableFrom(annotationClass)) {
logger.log(TreeLogger.WARN, "Annotation error: expected " + expectedType.getCanonicalName()
+ ", got " + annotationClass.getCanonicalName());
return null;