URI baseUri = url.toURI();
staticEnv.setBaseURI(baseUri);
} catch (URISyntaxException e) {
log(PrintUtils.prettyPrintStackTrace(e, -1));
}
final XQueryModule module;
try {
module = parser.parse();
} catch (XQueryException e) {
log(PrintUtils.prettyPrintStackTrace(e, -1));
_lock.readLock().unlock();
throw e;
}
_lock.readLock().unlock();
_lock.writeLock().lock();
// set query cache
cached.queryObject = module;
cached.staticEnv = staticEnv;
cached.loadTimeStamp = System.currentTimeMillis();
_caches.put(path, cached);
_lock.writeLock().unlock();
_lock.readLock().lock();
// static analysis
try {
module.staticAnalysis(staticEnv);
} catch (XQueryException e) {
log(PrintUtils.prettyPrintStackTrace(e, -1));
_lock.readLock().unlock();
throw e;
}