JavaCompiler<T> javaCompiler = new JavaCompiler<T>(parent.getClassLoader(), fileManagerCache.get(parent), commandline);
Class<T> result = javaCompiler.compile(className, source, null, Object.class);
fileManagerCache.put(result, javaCompiler.getFileManager());
return result;
} catch (ClassCastException e) {
throw new JavaCompilation(e.getMessage(), vf.sourceLocation(loc));
} catch (JavaCompilerException e) {
throw new JavaCompilation("with classpath [" + config.getRascalJavaClassPathProperty() + "]: " + e.getDiagnostics().getDiagnostics().iterator().next().getMessage(null), vf.sourceLocation(loc));
}
}