You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2017/08/22 06:41:44 UTC

[2/2] lucene-solr:branch_7x: Rename assertUnpositioned to checkUnpositioned since this is a hard exception and not an assertion.

Rename assertUnpositioned to checkUnpositioned since this is a hard exception and not an assertion.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/132c9d5b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/132c9d5b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/132c9d5b

Branch: refs/heads/branch_7x
Commit: 132c9d5b859d1e34dbc2ae274eae89d74276eb0d
Parents: 08aa3b3
Author: Adrien Grand <jp...@gmail.com>
Authored: Tue Aug 22 08:39:44 2017 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Tue Aug 22 08:41:12 2017 +0200

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/util/BitSet.java          | 4 ++--
 lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java     | 4 ++--
 .../core/src/java/org/apache/lucene/util/SparseFixedBitSet.java  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/132c9d5b/lucene/core/src/java/org/apache/lucene/util/BitSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/BitSet.java b/lucene/core/src/java/org/apache/lucene/util/BitSet.java
index 6f3a25c..b86219b 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);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/132c9d5b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
index 3668604e..143b10b 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
   @Override
   public 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);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/132c9d5b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
index 0cb9bc5..0324291 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 SparseFixedBitSet
       final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
       if (other != null) {
-        assertUnpositioned(it);
+        checkUnpositioned(it);
         or(other);
         return;
       }