LUCENE-6181: spatial pointsOnly check bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653057 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2015-01-19 17:16:54 +00:00
parent cb3ec682d4
commit 718141c5fe
1 changed files with 2 additions and 2 deletions

View File

@ -147,8 +147,8 @@ public abstract class PrefixTreeStrategy extends SpatialStrategy {
}
protected TokenStream createTokenStream(Shape shape, int detailLevel) {
if (pointsOnly && shape instanceof Point) {
throw new IllegalArgumentException("pointsOnly is true yet a point is given for indexing");
if (pointsOnly && !(shape instanceof Point)) {
throw new IllegalArgumentException("pointsOnly is true yet a " + shape.getClass() + " is given for indexing");
}
Iterator<Cell> cells = grid.getTreeCellIterator(shape, detailLevel);
return new CellTokenStream().setCells(cells);