Apache Lucene open-source search software
SOLR-2092: fix off-by-one in assert
Yonik Seeley495e614234e8
diff --git a/solr/src/java/org/apache/solr/request/SimpleFacets.java b/solr/src/java/org/apache/solr/request/SimpleFacets.javaindex 1173f6d576d..df962389bd0 100644--- a/solr/src/java/org/apache/solr/request/SimpleFacets.java+++ b/solr/src/java/org/apache/solr/request/SimpleFacets.java@@ -508,7 +508,7 @@ public class SimpleFacets {// if we are deep paging, we don't have to order the highest "offset" counts.int collectCount = Math.max(0, queue.size() - off);- assert collectCount < lim;+ assert collectCount <= lim;// the start and end indexes of our list "sorted" (starting with the highest value)int sortedIdxStart = queue.size() - (collectCount - 1);diff --git a/solr/src/java/org/apache/solr/request/UnInvertedField.java b/solr/src/java/org/apache/solr/request/UnInvertedField.javaindex 1a0ae8a71c8..eed1d6b1b17 100755--- a/solr/src/java/org/apache/solr/request/UnInvertedField.java+++ b/solr/src/java/org/apache/solr/request/UnInvertedField.java@@ -599,7 +599,7 @@ public class UnInvertedField {// if we are deep paging, we don't have to order the highest "offset" counts.int collectCount = Math.max(0, queue.size() - off);- assert collectCount < lim;+ assert collectCount <= lim;// the start and end indexes of our list "sorted" (starting with the highest value)int sortedIdxStart = queue.size() - (collectCount - 1);