protected void compile(String source, ClassType projectionType, String[] names, Type[] types,
String id, Map<String, Object> constants) throws IOException {
source = createSource(source, projectionType, names, types, id, constants);
SimpleJavaFileObject javaFileObject = new MemSourceFileObject(id, source);
Writer out = new StringWriter();
CompilationTask task = compiler.getTask(out, fileManager, null, compilationOptions, null,
Collections.singletonList(javaFileObject));
if (!task.call().booleanValue()) {
throw new CodegenException("Compilation of " + source + " failed.\n" + out.toString());
}
}