You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2018/12/11 18:17:25 UTC

[avro] branch master updated (d55f5e1 -> 4759048)

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git.


    from d55f5e1  AVRO-2034 Nested schema types with unexpected fields causes json parse failure (#224)
     new 254ee8f  [AVRO-2034] Remove conditions that will always be true/false
     new 4759048  Fix rat tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/java/org/apache/avro/io/JsonDecoder.java | 19 +++++++------------
 .../test/java/org/apache/avro/TestNestedRecords.java  | 17 +++++++++++++++++
 pom.xml                                               |  6 +++---
 3 files changed, 27 insertions(+), 15 deletions(-)


[avro] 02/02: Fix rat tests

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 475904893244b23e612073f9f8cf476380cec812
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Tue Dec 11 13:16:57 2018 -0500

    Fix rat tests
---
 .../test/java/org/apache/avro/TestNestedRecords.java    | 17 +++++++++++++++++
 pom.xml                                                 |  6 +++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/lang/java/avro/src/test/java/org/apache/avro/TestNestedRecords.java b/lang/java/avro/src/test/java/org/apache/avro/TestNestedRecords.java
index 8900b1e..9800512 100644
--- a/lang/java/avro/src/test/java/org/apache/avro/TestNestedRecords.java
+++ b/lang/java/avro/src/test/java/org/apache/avro/TestNestedRecords.java
@@ -1,3 +1,20 @@
+/*
+ * 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.apache.avro.generic.GenericData;
diff --git a/pom.xml b/pom.xml
index a8aa3c1..f44a3e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -326,9 +326,9 @@
                 <exclude>lang/c/src/st.h</exclude>
                 <exclude>lang/c/tests/msdirent.h</exclude>
                 <exclude>lang/c++/m4/*.m4</exclude>
-                <exclude>lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/static/protovis-r3.2.js</exclude>
-                <exclude>lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/static/g.bar.js</exclude>
-                <exclude>lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/static/jquery-1.4.2.min.js</exclude>
+                <exclude>lang/java/ipc/src/main/velocity/org/apache/avro/ipc/stats/static/protovis-r3.2.js</exclude>
+                <exclude>lang/java/ipc/src/main/velocity/org/apache/avro/ipc/stats/static/g.bar.js</exclude>
+                <exclude>lang/java/ipc/src/main/velocity/org/apache/avro/ipc/stats/static/jquery-1.4.2.min.js</exclude>
                 <!-- License files -->
                 <exclude>lang/java/tools/src/main/resources/META-INF/cddl-1.0.text</exclude>
                 <exclude>lang/java/tools/src/main/resources/META-INF/cddl-1.1.text</exclude>


[avro] 01/02: [AVRO-2034] Remove conditions that will always be true/false

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 254ee8ff595c6c52580128aec9355394f96382d5
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Tue Dec 11 13:14:29 2018 -0500

    [AVRO-2034] Remove conditions that will always be true/false
---
 .../src/main/java/org/apache/avro/io/JsonDecoder.java | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java b/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
index 0a6ef09..26a7b1e 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
@@ -500,21 +500,16 @@ public class JsonDecoder extends ParsingDecoder
         in.nextToken();
       }
 
-      if (in.getCurrentToken() == JsonToken.END_OBJECT) {
-
-        if (top == Symbol.RECORD_END) {
-          if (currentReorderBuffer != null && !currentReorderBuffer.savedFields.isEmpty()) {
-            throw error("Unknown fields: " + currentReorderBuffer.savedFields.keySet());
-          }
-          currentReorderBuffer = reorderBuffers.pop();
+      if (top == Symbol.RECORD_END) {
+        if (currentReorderBuffer != null && !currentReorderBuffer.savedFields.isEmpty()) {
+          throw error("Unknown fields: " + currentReorderBuffer.savedFields.keySet());
         }
+        currentReorderBuffer = reorderBuffers.pop();
+      }
 
-        //AVRO-2034 advance beyond the end object for the next record.
-        in.nextToken();
+      //AVRO-2034 advance beyond the end object for the next record.
+      in.nextToken();
 
-      } else {
-        throw error(top == Symbol.RECORD_END ? "record-end" : "union-end");
-      }
     } else {
       throw new AvroTypeException("Unknown action symbol " + top);
     }