hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1061081 - in /hbase/branches/0.90: 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:44:40 GMT
Author: stack
Date: Thu Jan 20 00:44:40 2011
New Revision: 1061081

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

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

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1061081&r1=1061080&r2=1061081&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Thu Jan 20 00:44:40 2011
@@ -1,6 +1,8 @@
 HBase Change Log
 Release 0.90.1 - Unreleased
   BUG FIXES
+   HBASE-3387  Revert 'Pair does not deep check arrays for equality'
+
   IMPROVEMENTS
 
 Release 0.90.0 - January 19th, 2011

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/Pair.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/Pair.java?rev=1061081&r1=1061080&r2=1061081&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/Pair.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/Pair.java Thu Jan 20 00:44:40
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.
@@ -88,35 +87,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