Compare instance of predicates, not exact class
We want the same behavior for any instance of the boolean predicates, not just for the exact boolean classes. Change-Id: I2d1168c7a69e03db4b8dda3ddf60275a603c3e27
This commit is contained in:
committed by
Dave Borowitz
parent
ec4418b3e8
commit
e12cf645de
@@ -54,11 +54,11 @@ public class QueryBuilder {
|
||||
|
||||
public static Query toQuery(Predicate<ChangeData> p)
|
||||
throws QueryParseException {
|
||||
if (p.getClass() == AndPredicate.class) {
|
||||
if (p instanceof AndPredicate) {
|
||||
return booleanQuery(p, MUST);
|
||||
} else if (p.getClass() == OrPredicate.class) {
|
||||
} else if (p instanceof OrPredicate) {
|
||||
return booleanQuery(p, SHOULD);
|
||||
} else if (p.getClass() == NotPredicate.class) {
|
||||
} else if (p instanceof NotPredicate) {
|
||||
if (p.getChild(0) instanceof TimestampRangePredicate) {
|
||||
return notTimestampQuery(
|
||||
(TimestampRangePredicate<ChangeData>) p.getChild(0));
|
||||
|
||||
Reference in New Issue
Block a user