avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1179356 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/Schema.java lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
Date Wed, 05 Oct 2011 18:11:01 GMT
Author: cutting
Date: Wed Oct  5 18:11:01 2011
New Revision: 1179356

URL: http://svn.apache.org/viewvc?rev=1179356&view=rev
Log:
AVRO-906. Java: Fix so that ordering of schema properties is consistent.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java
    avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1179356&r1=1179355&r2=1179356&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Wed Oct  5 18:11:01 2011
@@ -105,6 +105,9 @@ Avro 1.6.0 (unreleased)
     AVRO-895. JsonDecoder does not tolerate JSON records with
     different field order. (thiru)
 
+    AVRO-906. Java: Fix so that ordering of schema properties is
+    consistent. (cutting)
+
 Avro 1.5.4 (12 September 2011)
 
   IMPROVEMENTS

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java?rev=1179356&r1=1179355&r2=1179356&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java Wed Oct  5 18:11:01
2011
@@ -112,7 +112,7 @@ public abstract class Schema {
     }
   }
 
-  private static final class Props extends HashMap<String,String> {
+  private static final class Props extends LinkedHashMap<String,String> {
     private Set<String> reserved;
     public Props(Set<String> reserved) {
       super(1);

Modified: avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java?rev=1179356&r1=1179355&r2=1179356&view=diff
==============================================================================
--- avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java (original)
+++ avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java Wed Oct  5 18:11:01
2011
@@ -421,6 +421,12 @@ public class TestSchema {
     assertEquals(null, s.getProp("foo"));
   }
   
+  @Test public void testPropOrdering() throws Exception {
+    String json = "{\"type\":\"int\",\"z\":\"c\",\"yy\":\"b\",\"x\":\"a\"}";
+    Schema s = Schema.parse(json);
+    assertEquals(json, s.toString());
+  }
+
   @Test
   public void testParseInputStream() throws IOException {
     Schema s = Schema.parse(



Mime
View raw message