You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/04/03 04:43:17 UTC

git commit: Throw IllegalStateException instead of using asserts

Repository: cassandra
Updated Branches:
  refs/heads/trunk 6e9140ab6 -> 4ebf82cc3


Throw IllegalStateException instead of using asserts


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4ebf82cc
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4ebf82cc
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4ebf82cc

Branch: refs/heads/trunk
Commit: 4ebf82cc306ce4ef719abbb960d3f44b33f173af
Parents: 6e9140a
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Thu Apr 3 05:42:59 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Thu Apr 3 05:42:59 2014 +0300

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4ebf82cc/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java b/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java
index 0fe4448..d79edd3 100644
--- a/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java
+++ b/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java
@@ -441,6 +441,7 @@ public class ArrayBackedSortedColumns extends ColumnFamily
     public SearchIterator<CellName, Cell> searchIterator()
     {
         maybeSortCells();
+
         return new SearchIterator<CellName, Cell>()
         {
             // the first index that we could find the next key at, i.e. one larger
@@ -459,8 +460,8 @@ public class ArrayBackedSortedColumns extends ColumnFamily
 
             public Cell next(CellName name)
             {
-                assert sortedSize == size;
-                assert hasNext();
+                if (!isSorted || !hasNext())
+                    throw new IllegalStateException();
 
                 // optimize for runs of sequential matches, as in CollationController
                 // checking to see if we've found the desired cells yet (CASSANDRA-6933)