Author: avandana
Date: Thu Jun 28 20:31:01 2012
New Revision: 1355148

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

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/data/schema/HCatSchema.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1355148&r1=1355147&r2=1355148&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Thu Jun 28 20:31:01 2012
@@ -55,6 +55,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/trunk/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/data/schema/HCatSchema.java?rev=1355148&r1=1355147&r2=1355148&view=diff
==============================================================================
--- 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
 (original)
+++ 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/data/schema/HCatSchema.java
 Thu Jun 28 20:31:01 2012
@@ -159,9 +159,21 @@ public class HCatSchema implements Seria
     }
 
     @Override
-    public boolean equals(Object other) {
-        return !((other == null) || !(other instanceof HCatSchema))
-            && this.hashCode() == other.hashCode();
+    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


Reply via email to