Move QueryBuilder.badFieldType to FieldType class
This allows the method to be used without having a dependency on the gerrit-lucene module, which in turn has a dependency on a specific version of Lucene. Change-Id: I57e92c71260a51327ed706bd65f8f9e384e15666
This commit is contained in:
@@ -554,7 +554,7 @@ public class LuceneChangeIndex implements ChangeIndex {
|
||||
doc.add(new StoredField(name, (byte[]) value));
|
||||
}
|
||||
} else {
|
||||
throw QueryBuilder.badFieldType(type);
|
||||
throw FieldType.badFieldType(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -148,7 +148,7 @@ public class QueryBuilder {
|
||||
} else if (p.getType() == FieldType.FULL_TEXT) {
|
||||
return fullTextQuery(p);
|
||||
} else {
|
||||
throw badFieldType(p.getType());
|
||||
throw FieldType.badFieldType(p.getType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,8 +249,4 @@ public class QueryBuilder {
|
||||
public int toIndexTimeInMinutes(Date ts) {
|
||||
return (int) (ts.getTime() / 60000);
|
||||
}
|
||||
|
||||
public static IllegalArgumentException badFieldType(FieldType<?> t) {
|
||||
return new IllegalArgumentException("unknown index field type " + t);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user