throw new SAXException(e);
}
}
private CajoledModule cajole(String text, String name) {
MessageQueue mq = new EchoingMessageQueue(
new PrintWriter(System.err), new MessageContext(), false);
PluginMeta pm = new PluginMeta();
pm.setPrecajoleMap(null);
ModuleManager mgr = new ModuleManager(
pm, BuildInfo.getInstance(),
UriFetcher.NULL_NETWORK, mq);
UncajoledModule input = uncajoled(text, name, mq);
// TODO(felix8a): maybe should use compilation pipeline
ArrayIndexOptimization.optimize(input);
ParseTreeNode result = new ExpressionSanitizerCaja(mgr, null)
.sanitize(input);
if (mq.hasMessageAtLevel(MessageLevel.ERROR)) {
throw new BuildException("Failed to cajole " + name);
}
if (!(result instanceof CajoledModule)) {
throw new BuildException("No CajoledModule for " + name);
}