Follow up to #4411

patch by slebresne; reviewed by jbellis for CASSANDRA-4411


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

Branch: refs/heads/trunk
Commit: 35335caa034d5a22dd27058d011b1454fcc87850
Parents: 02030dd
Author: Sylvain Lebresne <[email protected]>
Authored: Mon Jul 16 17:31:55 2012 +0200
Committer: Sylvain Lebresne <[email protected]>
Committed: Mon Jul 16 17:31:55 2012 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/dht/Bounds.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/35335caa/src/java/org/apache/cassandra/dht/Bounds.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/Bounds.java 
b/src/java/org/apache/cassandra/dht/Bounds.java
index b5633c8..c6378a7 100644
--- a/src/java/org/apache/cassandra/dht/Bounds.java
+++ b/src/java/org/apache/cassandra/dht/Bounds.java
@@ -47,10 +47,10 @@ public class Bounds<T extends RingPosition> extends 
AbstractBounds<T>
 
     public boolean contains(T position)
     {
-        // Range.contains doesnt work correctly if left == right because for
-        // Range that means a wrapping range that select the whole ring. So we
-        // must explicitely handle this case
-        return left.equals(position) || (!left.equals(right) && 
Range.contains(left, right, position));
+        // Range.contains doesnt work correctly if left == right (unless both
+        // are minimum) because for Range that means a wrapping range that 
select
+        // the whole ring. So we must explicitely handle this case
+        return left.equals(position) || ((right.isMinimum(partitioner) || 
!left.equals(right)) && Range.contains(left, right, position));
     }
 
     public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position)

Reply via email to