Merge branch 'stable-2.9'

* stable-2.9:
  Cherry-pick: Bump database row version to invalidate ETag cache
  Fix consultRules so that it does not bail out on RuntimeException

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeInserter.java

Change-Id: I5d7fb4cc49819258e589e6b8023814eba0370988
This commit is contained in:
David Pursehouse
2014-06-24 10:46:27 +09:00
2 changed files with 13 additions and 6 deletions

View File

@@ -195,14 +195,17 @@ public class RulesCache {
return pmc;
}
private PrologMachineCopy consultRules(String name, Reader rules) {
private PrologMachineCopy consultRules(String name, Reader rules)
throws CompileException {
BufferingPrologControl ctl = newEmptyMachine(systemLoader);
PushbackReader in = new PushbackReader(rules, Prolog.PUSHBACK_SIZE);
if (!ctl.execute(
Prolog.BUILTIN, "consult_stream",
SymbolTerm.intern(name),
new JavaObjectTerm(in))) {
return null;
try {
if (!ctl.execute(Prolog.BUILTIN, "consult_stream",
SymbolTerm.intern(name), new JavaObjectTerm(in))) {
return null;
}
} catch (RuntimeException e) {
throw new CompileException("Error while consulting rules from " + name, e);
}
return save(ctl);
}