hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1061082 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/util/Pair.java src/test/java/org/apache/hadoop/hbase/util/TestPairEquals.java
Date Thu, 20 Jan 2011 00:47:29 GMT
Author: stack
Date: Thu Jan 20 00:47:29 2011
New Revision: 1061082

URL: http://svn.apache.org/viewvc?rev=1061082&view=rev
Log:
HBASE-3387 Pair does not deep check arrays for equality -- REVERTED

Removed:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestPairEquals.java
Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Pair.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1061082&r1=1061081&r2=1061082&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Jan 20 00:47:29 2011
@@ -25,6 +25,7 @@ Release 0.91.0 - Unreleased
    HBASE-3418  Increment operations can break when qualifiers are split
                between memstore/snapshot and storefiles
    HBASE-3403  Region orphaned after failure during split
+   HBASE-3387  Pair does not deep check arrays for equality -- REVERT THIS PATCH
 
 
   IMPROVEMENTS
@@ -57,7 +58,7 @@ Release 0.91.0 - Unreleased
    HBASE-3256  Coprocessors: Coprocessor host and observer for HMaster
 
 
-Release 0.90.0 - Unreleased
+Release 0.90.0 - January 19th, 2011
   INCOMPATIBLE CHANGES
    HBASE-1822  Remove the deprecated APIs
    HBASE-1848  Fixup shell for HBASE-1822

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Pair.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Pair.java?rev=1061082&r1=1061081&r2=1061082&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Pair.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Pair.java Thu Jan 20 00:47:29 2011
@@ -21,7 +21,6 @@
 package org.apache.hadoop.hbase.util;
 
 import java.io.Serializable;
-import java.lang.reflect.Array;
 
 /**
  * A generic class for pairs.
@@ -100,35 +99,9 @@ public class Pair<T1, T2> implements Ser
     return second;
   }
 
-  private static boolean equals(Object x, Object y) {
-    if (x == null && y == null)
-      return true;
-
-    if (x != null && y != null) {
-      if (x.getClass().equals(y.getClass())) {
-        if (x.getClass().isArray() && y.getClass().isArray()) {
-
-          int len = Array.getLength(x) == Array.getLength(y) ? Array
-              .getLength(x) : -1;
-          if (len < 0)
-            return false;
-
-          for (int i = 0; i < len; i++) {
-
-            Object xi = Array.get(x, i);
-            Object yi = Array.get(y, i);
-
-            if (!xi.equals(yi))
-              return false;
-          }
-          return true;
-        } else {
-          return x.equals(y);
-        }
-      }
-    }
-    return false;
-
+  private static boolean equals(Object x, Object y)
+  {
+    return (x == null && y == null) || (x != null && x.equals(y));
   }
 
   @Override



Mime
View raw message