}
private void verifyCompilePhase(AnnotationNode annotation, Class<?> klass) {
GroovyASTTransformation transformationClass = klass.getAnnotation(GroovyASTTransformation.class);
if (transformationClass != null) {
CompilePhase specifiedCompilePhase = transformationClass.phase();
if (specifiedCompilePhase.getPhaseNumber() < CompilePhase.SEMANTIC_ANALYSIS.getPhaseNumber()) {
source.getErrorCollector().addError(
new SimpleMessage(
annotation.getClassNode().getName() + " is defined to be run in compile phase " + specifiedCompilePhase + ". Local AST transformations must run in " + CompilePhase.SEMANTIC_ANALYSIS + " or later!",
source));
}