avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r779220 - in /hadoop/avro/trunk: CHANGES.txt src/java/org/apache/avro/Schema.java src/test/java/org/apache/avro/TestSchema.java
Date Wed, 27 May 2009 16:06:45 GMT
Author: cutting
Date: Wed May 27 16:06:45 2009
New Revision: 779220

URL: http://svn.apache.org/viewvc?rev=779220&view=rev
Log:
AVRO-39.  Fix bug in Java record schema toString().  Contributed by sharad.

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

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=779220&r1=779219&r2=779220&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Wed May 27 16:06:45 2009
@@ -70,3 +70,5 @@
 
     AVRO-22. When parsing schemas in Java, do not permit anonymous.
     (cutting)
+
+    AVRO-39. Fix bug in Java record schema toString().  (sharad)

Modified: hadoop/avro/trunk/src/java/org/apache/avro/Schema.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/java/org/apache/avro/Schema.java?rev=779220&r1=779219&r2=779220&view=diff
==============================================================================
--- hadoop/avro/trunk/src/java/org/apache/avro/Schema.java (original)
+++ hadoop/avro/trunk/src/java/org/apache/avro/Schema.java Wed May 27 16:06:45 2009
@@ -342,7 +342,7 @@
         buffer.append("\", \"type\": ");
         buffer.append(entry.getValue().schema().toString(names));
         if (entry.getValue().defaultValue() != null) {
-          buffer.append("\", \"default\": ");
+          buffer.append(", \"default\": ");
           buffer.append(entry.getValue().defaultValue());
         }
         buffer.append("}");

Modified: hadoop/avro/trunk/src/test/java/org/apache/avro/TestSchema.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/test/java/org/apache/avro/TestSchema.java?rev=779220&r1=779219&r2=779220&view=diff
==============================================================================
--- hadoop/avro/trunk/src/test/java/org/apache/avro/TestSchema.java (original)
+++ hadoop/avro/trunk/src/test/java/org/apache/avro/TestSchema.java Wed May 27 16:06:45 2009
@@ -225,6 +225,7 @@
     GenericData.Record record = (GenericData.Record)
       in.read(null, new ValueReader(new ByteArrayInputStream(new byte[0])));
     assertEquals("Wrong default.", defaultValue, record.get("f"));
+    assertEquals("Wrong toString", expected, Schema.parse(expected.toString()));
   }
 
 }



Mime
View raw message