private ClassNode getTargetClass(SourceUnit source, AnnotationNode annotation) {
Expression value = annotation.getMember("value");
if (value == null || !(value instanceof ClassExpression)) {
//noinspection ThrowableInstanceNeverThrown
source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(
new SyntaxException("@groovy.lang.Category must define 'value' which is the class to apply this category to",
annotation.getLineNumber(), annotation.getColumnNumber(), annotation.getLastLineNumber(), annotation.getLastColumnNumber()),
source));
return null;
} else {
ClassExpression ce = (ClassExpression) value;