avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r828100 - in /hadoop/avro/trunk: CHANGES.txt src/test/java/org/apache/avro/TestReflect.java
Date Wed, 21 Oct 2009 16:47:27 GMT
Author: cutting
Date: Wed Oct 21 16:47:27 2009
New Revision: 828100

URL: http://svn.apache.org/viewvc?rev=828100&view=rev
Log:
AVRO-165.  Fix an equals implementation in TestReflect.  Contributed by Philip Zeyliger.

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/src/test/java/org/apache/avro/TestReflect.java

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=828100&r1=828099&r2=828100&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Wed Oct 21 16:47:27 2009
@@ -30,6 +30,9 @@
     AVRO-156.  Fix broken links to Wiki in documentation.
     (Jeff Hammerbacher via cutting)
 
+    AVRO-165.  Fix an equals implementation in TestReflect.
+    (Philip Zeyliger via cutting)
+
 Avro 1.2.0 (14 October 2009)
 
   INCOMPATIBLE CHANGES

Modified: hadoop/avro/trunk/src/test/java/org/apache/avro/TestReflect.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/test/java/org/apache/avro/TestReflect.java?rev=828100&r1=828099&r2=828100&view=diff
==============================================================================
--- hadoop/avro/trunk/src/test/java/org/apache/avro/TestReflect.java (original)
+++ hadoop/avro/trunk/src/test/java/org/apache/avro/TestReflect.java Wed Oct 21 16:47:27 2009
@@ -136,13 +136,16 @@
       public boolean equals(Object other) {
         if (other instanceof AnotherSampleRecord) {
           AnotherSampleRecord o = (AnotherSampleRecord) other;
-          boolean equals = this.a == o.a;
-          if (this.s == null && o.s != null)
-            equals = false;
-          if (this.s != null && this.s.equals(o.s))
-            equals = true;
+          if ( (this.a == null && o.a != null) ||
+               (this.a != null && !this.a.equals(o.a)) ||
+               (this.s == null && o.s != null) ||
+               (this.s != null && !this.s.equals(o.s)) ) {
+            return false;
+          }
+          return true;
+        } else {
+          return false;
         }
-        return true;
       }
     }
   }



Mime
View raw message