incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avand...@apache.org
Subject svn commit: r1355149 - in /incubator/hcatalog/branches/branch-0.4: CHANGES.txt src/java/org/apache/hcatalog/data/schema/HCatSchema.java
Date Thu, 28 Jun 2012 20:32:33 GMT
Author: avandana
Date: Thu Jun 28 20:32:32 2012
New Revision: 1355149

URL: http://svn.apache.org/viewvc?rev=1355149&view=rev
Log:
HCAT-437 HCatSchema's equals() implementation uses hashcode obtained from toString() method.
(merged from trunk)

Modified:
    incubator/hcatalog/branches/branch-0.4/CHANGES.txt
    incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/data/schema/HCatSchema.java

Modified: incubator/hcatalog/branches/branch-0.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/CHANGES.txt?rev=1355149&r1=1355148&r2=1355149&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/CHANGES.txt (original)
+++ incubator/hcatalog/branches/branch-0.4/CHANGES.txt Thu Jun 28 20:32:32 2012
@@ -49,6 +49,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-437 HCatSchema's equals() implementation uses hashcode obtained from toString() method.
(avandana)
+
   HCAT-438 HCatFieldSchema class does not have equals() method implementation (avandana)
 
   HCAT_416 MultiOutputFormat should handle merging of DistributedCache configurations (rohini
via avandana)

Modified: incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/data/schema/HCatSchema.java?rev=1355149&r1=1355148&r2=1355149&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
(original)
+++ incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
Thu Jun 28 20:32:32 2012
@@ -157,4 +157,27 @@ public class HCatSchema implements Seria
         }
         return sb.toString();
     }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (!(obj instanceof HCatSchema)) {
+            return false;
+        }
+        HCatSchema other = (HCatSchema) obj;
+       if (!this.getFields().equals(other.getFields())) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return toString().hashCode();
+    }
 }



Mime
View raw message