avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From th...@apache.org
Subject svn commit: r960427 - in /avro/trunk: ./ lang/java/src/java/org/apache/avro/io/parsing/ lang/java/src/test/java/org/apache/avro/io/
Date Mon, 05 Jul 2010 03:17:07 GMT
Author: thiru
Date: Mon Jul  5 03:17:04 2010
New Revision: 960427

URL: http://svn.apache.org/viewvc?rev=960427&view=rev
Log:
AVRO-589. ClassCastException: org.apache.avro.io.parsing.Symbol$Alternative cannot be cast
to org.apache.avro.io.parsing.Symbol$UnionAdjustAction

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/src/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIO.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=960427&r1=960426&r2=960427&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Mon Jul  5 03:17:04 2010
@@ -77,6 +77,8 @@ Avro 1.4.0 (unreleased)
     AVRO-571. Fix how we handle out-of-bounds indexes for union and 
     enum parsing in Python (hammer)
 
+    AVRO-589. ClassCastException: org.apache.avro.io.parsing.Symbol$Alternative cannot be
cast to org.apache.avro.io.parsing.Symbol$UnionAdjustAction (thiru)
+
 Avro 1.3.3 (7 June 2010)
 
   IMPROVEMENTS

Modified: avro/trunk/lang/java/src/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java?rev=960427&r1=960426&r2=960427&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
(original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java
Mon Jul  5 03:17:04 2010
@@ -249,8 +249,7 @@ public class ResolvingGrammarGenerator e
         Field rf = reader.getField(fname);
         if (rf == null) {
           production[--count] =
-            new Symbol.SkipAction(super.generate(wf.schema(),
-              seen));
+            new Symbol.SkipAction(generate(wf.schema(), wf.schema(), seen));
         } else {
           production[--count] =
             generate(wf.schema(), rf.schema(), seen);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIO.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIO.java?rev=960427&r1=960426&r2=960427&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIO.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIO.java Mon Jul  5
03:17:04 2010
@@ -54,7 +54,7 @@ public class TestResolvingIO {
   
   @Test
   public void testIdentical() throws IOException {
-    performTest(eEnc, iSkipL, sJsWrtSchm, sWrtCls, sJsRdrSchm, sRdrCls);
+    performTest(eEnc, iSkipL, sJsWrtSchm, sWrtCls, sJsWrtSchm, sWrtCls);
   }
 
   private static final int COUNT = 10;

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java?rev=960427&r1=960426&r2=960427&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/io/TestResolvingIOResolving.java Mon
Jul  5 03:17:04 2010
@@ -175,6 +175,19 @@ public class TestResolvingIOResolving {
             "[ \"long\", \"string\"]", "U0L", new Object[] { 100L } },
         { "[ \"int\", \"string\"]", "U0I", new Object[] { 100 },
             "\"long\"", "L", new Object[] { 100 } },
+        // Record where union field is skipped.
+        { "{\"type\":\"record\",\"name\":\"r\",\"fields\":["
+          + "{\"name\":\"f0\", \"type\":\"boolean\"},"
+          + "{\"name\":\"f1\", \"type\":\"int\"},"
+          + "{\"name\":\"f2\", \"type\":[\"int\", \"long\"]},"
+          + "{\"name\":\"f3\", \"type\":\"float\"}"
+          + "]}", "BIU0IF",
+          new Object[] { true, 100, 121, 10.75f },
+          "{\"type\":\"record\",\"name\":\"r\",\"fields\":["
+          + "{\"name\":\"f0\", \"type\":\"boolean\"},"
+          + "{\"name\":\"f1\", \"type\":\"long\"},"
+          + "{\"name\":\"f3\", \"type\":\"double\"}]}", "BLD",
+          new Object[] { true, 100L, 10.75d } },
     };
   }
 }



Mime
View raw message