cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: simply: no need for iterator to get first item in List
Date Sun, 09 Mar 2014 02:39:07 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk b730e5f26 -> 572d32876


simply: no need for iterator to get first item in List


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

Branch: refs/heads/trunk
Commit: 572d328762bee9100549963a6826fdb9f633af2a
Parents: b730e5f
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sat Mar 8 21:38:23 2014 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sat Mar 8 21:38:23 2014 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/cql3/statements/UpdateStatement.java    | 2 +-
 test/unit/org/apache/cassandra/db/RowIterationTest.java          | 4 ++--
 test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/572d3287/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 85ca069..b0c7db8 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -71,7 +71,7 @@ public class UpdateStatement extends ModificationStatement
         if (cfm.comparator.isDense())
         {
             if (prefix.isEmpty())
-                throw new InvalidRequestException(String.format("Missing PRIMARY KEY part
%s", cfm.clusteringColumns().iterator().next()));
+                throw new InvalidRequestException(String.format("Missing PRIMARY KEY part
%s", cfm.clusteringColumns().get(0)));
 
             // An empty name for the compact value is what we use to recognize the case where
there is not column
             // outside the PK, see CreateStatement.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/572d3287/test/unit/org/apache/cassandra/db/RowIterationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/RowIterationTest.java b/test/unit/org/apache/cassandra/db/RowIterationTest.java
index bfba858..34fbf82 100644
--- a/test/unit/org/apache/cassandra/db/RowIterationTest.java
+++ b/test/unit/org/apache/cassandra/db/RowIterationTest.java
@@ -82,7 +82,7 @@ public class RowIterationTest extends SchemaLoader
         rm.apply();
         store.forceBlockingFlush();
 
-        ColumnFamily cf = Util.getRangeSlice(store).iterator().next().cf;
+        ColumnFamily cf = Util.getRangeSlice(store).get(0).cf;
         assert cf.deletionInfo().equals(delInfo2);
     }
 
@@ -100,7 +100,7 @@ public class RowIterationTest extends SchemaLoader
         rm.apply();
         store.forceBlockingFlush();
 
-        ColumnFamily cf = Util.getRangeSlice(store).iterator().next().cf;
+        ColumnFamily cf = Util.getRangeSlice(store).get(0).cf;
         assert cf != null;
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/572d3287/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index bd50538..ecaa276 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -201,7 +201,7 @@ public class SSTableReaderTest extends SchemaLoader
         long p6 = sstable.getPosition(k(6), SSTableReader.Operator.EQ).position;
         long p7 = sstable.getPosition(k(7), SSTableReader.Operator.EQ).position;
 
-        Pair<Long, Long> p = sstable.getPositionsForRanges(makeRanges(t(2), t(6))).iterator().next();
+        Pair<Long, Long> p = sstable.getPositionsForRanges(makeRanges(t(2), t(6))).get(0);
 
         // range are start exclusive so we should start at 3
         assert p.left == p3;


Mime
View raw message