CompileOptions options = ((JavaCompileSpec) spec).getCompileOptions();
@SuppressWarnings("unchecked") Compiler<T> compiler = (Compiler<T>) compilerFactory.create(options);
return compiler;
}
if (spec instanceof JavadocSpec) {
@SuppressWarnings("unchecked") Compiler<T> compiler = (Compiler<T>) new JavadocGenerator(execActionFactory);
return compiler;
}
throw new IllegalArgumentException(String.format("Don't know how to compile using spec of type %s.", spec.getClass().getSimpleName()));
}