avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1483463 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/Schema.java
Date Thu, 16 May 2013 17:33:53 GMT
Author: cutting
Date: Thu May 16 17:33:53 2013
New Revision: 1483463

URL: http://svn.apache.org/r1483463
Log:
AVRO-1331. Java: Fix schema-parsing incompatibility introduced in AVRO-1295.

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

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1483463&r1=1483462&r2=1483463&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu May 16 17:33:53 2013
@@ -86,6 +86,9 @@ Trunk (not yet released)
     AVRO-1316. Java: Fix compiler to split long schema string
     constants so javac can compile them. (Jeremy Kahn via cutting)
 
+    AVRO-1331. Java: Fix schema-parsing incompatibility from AVRO-1295.
+    (cutting)
+
 Avro 1.7.4 (22 February 2012)
 
   NEW FEATURES

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=1483463&r1=1483462&r2=1483463&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 Thu May 16 17:33:53
2013
@@ -1068,7 +1068,7 @@ public abstract class Schema extends Jso
       Schema result;
       String type = getRequiredText(schema, "type", "No type");
       Name name = null;
-      String savedSpace = null;
+      String savedSpace = names.space();
       String doc = null;
       if (type.equals("record") || type.equals("error")
           || type.equals("enum") || type.equals("fixed")) {
@@ -1079,7 +1079,6 @@ public abstract class Schema extends Jso
         name = new Name(getRequiredText(schema, "name", "No name in schema"),
                         space);
         if (name.space != null) {                 // set default namespace
-          savedSpace = names.space();
           names.space(name.space);
         }
       }
@@ -1161,8 +1160,7 @@ public abstract class Schema extends Jso
         if (!SCHEMA_RESERVED.contains(prop))      // ignore reserved
           result.addProp(prop, schema.get(prop));
       }
-      if (savedSpace != null)
-        names.space(savedSpace);                  // restore space
+      names.space(savedSpace);                  // restore space
       if (result instanceof NamedSchema) {
         Set<String> aliases = parseAliases(schema);
         if (aliases != null)                      // add aliases



Mime
View raw message