- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
@SuppressWarnings("unused")
// Sure it's used. By Guice. So stop complaining.
protected ColQueryProvider() {
try {
// Exhibit one: ye olde dependency hell.
// We *should* be able to just use new EclipseCompiler(), but GWT complains
// in dev mode when ECJ is in the Eclipse classpath. So it's not.
// ECJ is still loaded by the servlet container, so this is not an issue in deployment.
final JavaCompiler compiler = (JavaCompiler)
Class.forName("org.eclipse.jdt.internal.compiler.tool.EclipseCompiler").newInstance();
// Tweaked based on QueryEngine.DEFAULT
final DefaultEvaluatorFactory evaluatorFactory = new DefaultEvaluatorFactory(ColQueryTemplates.DEFAULT,
(URLClassLoader) DefaultEvaluatorFactory.class.getClassLoader(), compiler);
queryEngine = new DefaultQueryEngine(evaluatorFactory);
} catch (final ClassNotFoundException e) {
throw new ProvisionException("Eclipse compiler cannot be loaded", e);
} catch (final InstantiationException e) {
throw new ProvisionException("Eclipse compiler cannot be loaded", e);
} catch (final IllegalAccessException e) {
throw new ProvisionException("Eclipse compiler cannot be loaded", e);
}
}
Комментарии (0) RSS
Добавить комментарий