cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] cassandra git commit: Fixed coverity defects Reviewed by Marcus Olsson for CASSANDRA-5220
Date Tue, 11 Aug 2015 13:36:45 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 622e8a3e9 -> 2a656e6bd
  refs/heads/trunk 9f83e6a23 -> 4a748f315


Fixed coverity defects
Reviewed by Marcus Olsson for CASSANDRA-5220


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

Branch: refs/heads/cassandra-3.0
Commit: 2a656e6bd5e1f5ac8161b65a211dd8bed74b7def
Parents: 622e8a3
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Fri Aug 7 08:29:59 2015 +0800
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Aug 11 08:36:17 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/utils/MerkleTrees.java         | 4 +++-
 test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2a656e6b/src/java/org/apache/cassandra/utils/MerkleTrees.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/MerkleTrees.java b/src/java/org/apache/cassandra/utils/MerkleTrees.java
index 43c023e..b950b3b 100644
--- a/src/java/org/apache/cassandra/utils/MerkleTrees.java
+++ b/src/java/org/apache/cassandra/utils/MerkleTrees.java
@@ -125,6 +125,7 @@ public class MerkleTrees implements Iterable<Map.Entry<Range<Token>,
MerkleTree>
      * @param t
      * @return
      */
+    @VisibleForTesting
     public MerkleTree.TreeRange get(Token t)
     {
         return getMerkleTree(t).get(t);
@@ -167,6 +168,7 @@ public class MerkleTrees implements Iterable<Map.Entry<Range<Token>,
MerkleTree>
      * 
      * @param t
      */
+    @VisibleForTesting
     public void invalidate(Token t)
     {
         getMerkleTree(t).invalidate(t);
@@ -215,7 +217,7 @@ public class MerkleTrees implements Iterable<Map.Entry<Range<Token>,
MerkleTree>
                 return merkleTrees.get(range);
         }
 
-        return null;
+        throw new AssertionError("Expected tree for token " + t);
     }
 
     private void addTrees(Collection<MerkleTree> trees)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2a656e6b/test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java b/test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java
index db3f683..734e91b 100644
--- a/test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java
+++ b/test/unit/org/apache/cassandra/repair/LocalSyncTaskTest.java
@@ -20,9 +20,7 @@ package org.apache.cassandra.repair;
 
 import java.net.InetAddress;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 


Mime
View raw message