Follow up to #4411

patch by slebresne; reviewed by jbellis for CASSANDRA-4411
This commit is contained in:
Sylvain Lebresne 2012-07-16 17:31:55 +02:00
parent 02030dd658
commit 35335caa03
1 changed files with 4 additions and 4 deletions

View File

@ -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)