Skip to content

Apache Lucene open-source search software

LUCENE-4914: SpatialPrefixTree Cell.reset() forgot the 'leaf' flag.

David Wayne Smileya22e571189c3
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index ee15003347a..d1c19b996fd 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -225,6 +225,10 @@ Bug Fixes
* LUCENE-4877: Throw exception for invalid arguments in analysis factories.
(Steve Rowe, Uwe Schindler, Robert Muir)
+* LUCENE-4914: SpatialPrefixTree's Node/Cell.reset() forgot to reset the 'leaf'
+ flag. It affects SpatialRecursivePrefixTreeStrategy on non-point indexed
+ shapes, as of Lucene 4.2. (David Smiley)
+
Documentation
* LUCENE-4841: Added example SimpleSortedSetFacetsExample to show how
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/Cell.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/Cell.java
index ee28914eda2..b5bcb3e9302 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/Cell.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/Cell.java
@@ -91,6 +91,8 @@ public abstract class Cell implements Comparable<Cell> {
if (bytes[b_off + b_len - 1] == LEAF_BYTE) {
b_len--;
setLeaf();
+ } else {
+ leaf = false;
}
}