Update to Prolog Cafe 1.4

Prolog Cafe is now built with Buck and has a slightly smaller
runtime. Many features not required for Gerrit Code Review were
stripped out of the fork.

Package names were reorganized to make the runtime smaller to
read by pulling exceptions out to their own package. This is
a breaking change for any plugins that contribute a predicate.

Change-Id: Icb50d306dfda146497814c65e2c03fae416ec5e1
This commit is contained in:
Shawn Pearce
2015-03-06 12:11:16 -08:00
parent cc2b3b5f63
commit cc34990493
35 changed files with 164 additions and 154 deletions

View File

@@ -19,14 +19,16 @@ import com.google.gerrit.server.patch.PatchList;
import com.google.gerrit.server.patch.PatchListEntry;
import com.google.gerrit.server.patch.Text;
import com.googlecode.prolog_cafe.lang.IllegalTypeException;
import com.googlecode.prolog_cafe.lang.JavaException;
import com.googlecode.prolog_cafe.exceptions.IllegalTypeException;
import com.googlecode.prolog_cafe.exceptions.JavaException;
import com.googlecode.prolog_cafe.exceptions.PInstantiationException;
import com.googlecode.prolog_cafe.exceptions.PrologException;
import com.googlecode.prolog_cafe.lang.Operation;
import com.googlecode.prolog_cafe.lang.PInstantiationException;
import com.googlecode.prolog_cafe.lang.Predicate;
import com.googlecode.prolog_cafe.lang.Prolog;
import com.googlecode.prolog_cafe.lang.PrologException;
import com.googlecode.prolog_cafe.lang.SymbolTerm;
import com.googlecode.prolog_cafe.lang.Term;
import com.googlecode.prolog_cafe.lang.VariableTerm;
import org.eclipse.jgit.diff.Edit;
import org.eclipse.jgit.errors.CorruptObjectException;
@@ -134,10 +136,10 @@ public class PRED_commit_edits_2 extends Predicate.P2 {
}
private Pattern getRegexParameter(Term term) {
if (term.isVariable()) {
if (term instanceof VariableTerm) {
throw new PInstantiationException(this, 1);
}
if (!term.isSymbol()) {
if (!(term instanceof SymbolTerm)) {
throw new IllegalTypeException(this, 1, "symbol", term);
}
return Pattern.compile(term.name(), Pattern.MULTILINE);