cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/6] git commit: fix array comparisons with == patch by dbrosius; reviewed by jbellis for CASSANDRA-3976
Date Fri, 02 Mar 2012 00:23:56 GMT
fix array comparisons with ==
patch by dbrosius; reviewed by jbellis for CASSANDRA-3976


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

Branch: refs/heads/trunk
Commit: 0c2d2ccd962ded0f536c04f841bf22f45763e430
Parents: f22b223
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Mar 1 18:22:21 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Mar 1 18:22:21 2012 -0600

----------------------------------------------------------------------
 .../cassandra/hadoop/ColumnFamilyRecordReader.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0c2d2ccd/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
index 14d35ea..89cf840 100644
--- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
+++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
@@ -122,14 +122,15 @@ public class ColumnFamilyRecordReader extends RecordReader<ByteBuffer,
SortedMap
         if (predicate.getSlice_range() == null)
             return true;
 
-        byte[] start  = predicate.getSlice_range().getStart();
+        byte[] start = predicate.getSlice_range().getStart();
+        if ((start != null) && (start.length > 0))
+            return false;
+            
         byte[] finish = predicate.getSlice_range().getFinish();
-        if ( (start == null || start == ArrayUtils.EMPTY_BYTE_ARRAY) &&
-             (finish == null || finish == ArrayUtils.EMPTY_BYTE_ARRAY) )
-            return true;
-
+        if ((finish != null) && (finish.length > 0))
+            return false;
 
-        return false;
+        return true;
     }
 
     public void initialize(InputSplit split, TaskAttemptContext context) throws IOException


Mime
View raw message