From 718141c5feb216fd7de5f66bfd929784f004d470 Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Mon, 19 Jan 2015 17:16:54 +0000 Subject: [PATCH] LUCENE-6181: spatial pointsOnly check bug git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653057 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java index 76db62897ed..7ce92fa045e 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java @@ -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 cells = grid.getTreeCellIterator(shape, detailLevel); return new CellTokenStream().setCells(cells);