Apache Solr open-source search software
Rename assertUnpositioned to checkUnpositioned since this is a hard exception and not an assertion.
Adrien Grandea14a0721df9
diff --git a/lucene/core/src/java/org/apache/lucene/util/BitSet.java b/lucene/core/src/java/org/apache/lucene/util/BitSet.javaindex 6f3a25c5b75..b86219bb97a 100644--- a/lucene/core/src/java/org/apache/lucene/util/BitSet.java+++ b/lucene/core/src/java/org/apache/lucene/util/BitSet.java@@ -79,7 +79,7 @@ public abstract class BitSet implements MutableBits, Accountable {public abstract int nextSetBit(int index);/** Assert that the current doc is -1. */- protected final void assertUnpositioned(DocIdSetIterator iter) {+ protected final void checkUnpositioned(DocIdSetIterator iter) {if (iter.docID() != -1) {throw new IllegalStateException("This operation only works with an unpositioned iterator, got current position = " + iter.docID());}@@ -88,7 +88,7 @@ public abstract class BitSet implements MutableBits, Accountable {/** Does in-place OR of the bits provided by the iterator. The state of the* iterator after this operation terminates is undefined. */public void or(DocIdSetIterator iter) throws IOException {- assertUnpositioned(iter);+ checkUnpositioned(iter);for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) {set(doc);}diff --git a/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.javaindex 3668604e2d6..143b10b93c6 100644--- a/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java+++ b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java@@ -264,7 +264,7 @@ public final class FixedBitSet extends BitSet implements MutableBits, Accountabl@Overridepublic void or(DocIdSetIterator iter) throws IOException {if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {- assertUnpositioned(iter);+ checkUnpositioned(iter);final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);or(bits);} else {@@ -293,7 +293,7 @@ public final class FixedBitSet extends BitSet implements MutableBits, Accountabl/** Does in-place XOR of the bits provided by the iterator. */public void xor(DocIdSetIterator iter) throws IOException {- assertUnpositioned(iter);+ checkUnpositioned(iter);if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);xor(bits);diff --git a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.javaindex 0cb9bc54eac..0324291fc71 100644--- a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java+++ b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java@@ -413,7 +413,7 @@ public class SparseFixedBitSet extends BitSet implements Bits, Accountable {* {@link #or(DocIdSetIterator)} impl that works best when <code>it</code> is dense*/private void orDense(DocIdSetIterator it) throws IOException {- assertUnpositioned(it);+ checkUnpositioned(it);// The goal here is to try to take advantage of the ordering of documents// to build the data-structure more efficiently// NOTE: this heavily relies on the fact that shifts are mod 64@@ -466,7 +466,7 @@ public class SparseFixedBitSet extends BitSet implements Bits, Accountable {// specialize union with another SparseFixedBitSetfinal SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);if (other != null) {- assertUnpositioned(it);+ checkUnpositioned(it);or(other);return;}