You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by cu...@apache.org on 2012/05/17 23:23:05 UTC

svn commit: r1339867 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/Protocol.java lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java

Author: cutting
Date: Thu May 17 21:23:04 2012
New Revision: 1339867

URL: http://svn.apache.org/viewvc?rev=1339867&view=rev
Log:
AVRO-1076. Java: Fix Protocol#equals() to consider properties.  Contributed by Karthik K.

Added:
    avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java   (with props)
Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1339867&r1=1339866&r2=1339867&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu May 17 21:23:04 2012
@@ -71,6 +71,9 @@ Avro 1.7.0 (unreleased)
     AVRO-1056. Java: Fix reflect to correctly handle unions containing
     maps.  (Kevin Zhao via cutting)
 
+    AVRO-1076. Java: Fix Protocol#equals() to consider
+    properties. (Karthik K via cutting)
+
 Avro 1.6.3 (5 March 2012)
 
     AVRO-1077. Missing 'inline' for union set function. (thiru)

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java?rev=1339867&r1=1339866&r2=1339867&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java Thu May 17 21:23:04 2012
@@ -322,7 +322,7 @@ public class Protocol {
       && this.namespace.equals(that.namespace)
       && this.types.equals(that.types)
       && this.messages.equals(that.messages)
-      && this.props.equals(this.props);
+      && this.props.equals(that.props);
   }
   
   public int hashCode() {

Added: avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java?rev=1339867&view=auto
==============================================================================
--- avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java (added)
+++ avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java Thu May 17 21:23:04 2012
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.avro;
+
+import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+
+public class TestProtocol {
+
+  @Test public void testPropEquals() {
+    Protocol p1 = new Protocol("P", null, "foo");
+    p1.addProp("a","1");
+    Protocol p2 = new Protocol("P", null, "foo");
+    p2.addProp("a","2");
+    assertFalse(p1.equals(p2));
+  }
+
+}

Propchange: avro/trunk/lang/java/avro/src/test/java/org/apache/avro/TestProtocol.java
------------------------------------------------------------------------------
    svn:eol-style = native