You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ni...@apache.org on 2016/09/15 09:12:34 UTC

[1/2] avro git commit: AVRO-1913: No warnings in the generated Java code.

Repository: avro
Updated Branches:
  refs/heads/master 33d495840 -> 27cb9e271


AVRO-1913: No warnings in the generated Java code.


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/4810d48c
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/4810d48c
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/4810d48c

Branch: refs/heads/master
Commit: 4810d48cf9643850587e98a1cde17215feb24655
Parents: 33d4958
Author: Niels Basjes <nb...@bol.com>
Authored: Thu Sep 15 10:18:05 2016 +0200
Committer: Niels Basjes <nb...@bol.com>
Committed: Thu Sep 15 10:18:05 2016 +0200

----------------------------------------------------------------------
 CHANGES.txt                                            |  2 ++
 .../java/org/apache/avro/FooBarSpecificRecord.java     |  4 ++--
 .../compiler/specific/templates/java/classic/fixed.vm  |  4 ++--
 .../compiler/specific/templates/java/classic/record.vm | 13 +++++++++----
 .../output-string/avro/examples/baseball/Player.java   | 11 +++++++----
 lang/java/tools/src/test/compiler/output/Player.java   | 11 +++++++----
 6 files changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b5818cc..365c6bd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -56,6 +56,8 @@ Trunk (not yet released)
 
     AVRO-1900: Java: Remove dev-tools to fix Java build. (blue)
 
+    AVRO-1913: No warnings in the generated Java code. (Niels Basjes)
+
 Avro 1.8.1 (14 May 2016)
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/lang/java/avro/src/test/java/org/apache/avro/FooBarSpecificRecord.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/test/java/org/apache/avro/FooBarSpecificRecord.java b/lang/java/avro/src/test/java/org/apache/avro/FooBarSpecificRecord.java
index babcd36..bab3620 100644
--- a/lang/java/avro/src/test/java/org/apache/avro/FooBarSpecificRecord.java
+++ b/lang/java/avro/src/test/java/org/apache/avro/FooBarSpecificRecord.java
@@ -373,7 +373,7 @@ public class FooBarSpecificRecord extends org.apache.avro.specific.SpecificRecor
   }
 
   private static final org.apache.avro.io.DatumWriter
-    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
+    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter<FooBarSpecificRecord>(SCHEMA$);
 
   @Override public void writeExternal(java.io.ObjectOutput out)
     throws java.io.IOException {
@@ -381,7 +381,7 @@ public class FooBarSpecificRecord extends org.apache.avro.specific.SpecificRecor
   }
 
   private static final org.apache.avro.io.DatumReader
-    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
+    READER$ = new org.apache.avro.specific.SpecificDatumReader<FooBarSpecificRecord>(SCHEMA$);
 
   @Override public void readExternal(java.io.ObjectInput in)
     throws java.io.IOException {

http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
----------------------------------------------------------------------
diff --git a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
index b19e1b1..b06854e 100644
--- a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
+++ b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
@@ -47,7 +47,7 @@ public class ${this.mangle($schema.getName())} extends org.apache.avro.specific.
   }
 
   private static final org.apache.avro.io.DatumWriter
-    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
+    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter<${this.mangle($schema.getName())}>(SCHEMA$);
 
   @Override public void writeExternal(java.io.ObjectOutput out)
     throws java.io.IOException {
@@ -55,7 +55,7 @@ public class ${this.mangle($schema.getName())} extends org.apache.avro.specific.
   }
 
   private static final org.apache.avro.io.DatumReader
-    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
+    READER$ = new org.apache.avro.specific.SpecificDatumReader<${this.mangle($schema.getName())}>(SCHEMA$);
 
   @Override public void readExternal(java.io.ObjectInput in)
     throws java.io.IOException {

http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
----------------------------------------------------------------------
diff --git a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
index 1170d79..15ea734 100644
--- a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
+++ b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
@@ -20,8 +20,10 @@ package $schema.getNamespace();
 #end
 
 import org.apache.avro.specific.SpecificData;
+#if (!$schema.isError())
 import org.apache.avro.message.BinaryMessageEncoder;
 import org.apache.avro.message.BinaryMessageDecoder;
+#end
 
 @SuppressWarnings("all")
 #if ($schema.getDoc())
@@ -399,6 +401,7 @@ public class ${this.mangle($schema.getName())}#if ($schema.isError()) extends or
 
 #end
     @Override
+    @SuppressWarnings("unchecked")
     public ${this.mangle($schema.getName())} build() {
       try {
         ${this.mangle($schema.getName())} record = new ${this.mangle($schema.getName())}(#if ($schema.isError())getValue(), getCause()#end);
@@ -428,16 +431,18 @@ public class ${this.mangle($schema.getName())}#if ($schema.isError()) extends or
     }
   }
 
-  private static final org.apache.avro.io.DatumWriter
-    WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumWriter<${this.mangle($schema.getName())}>
+    WRITER$ = (org.apache.avro.io.DatumWriter<${this.mangle($schema.getName())}>)MODEL$.createDatumWriter(SCHEMA$);
 
   @Override public void writeExternal(java.io.ObjectOutput out)
     throws java.io.IOException {
     WRITER$.write(this, SpecificData.getEncoder(out));
   }
 
-  private static final org.apache.avro.io.DatumReader
-    READER$ = MODEL$.createDatumReader(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumReader<${this.mangle($schema.getName())}>
+    READER$ = (org.apache.avro.io.DatumReader<${this.mangle($schema.getName())}>)MODEL$.createDatumReader(SCHEMA$);
 
   @Override public void readExternal(java.io.ObjectInput in)
     throws java.io.IOException {

http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
----------------------------------------------------------------------
diff --git a/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java b/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
index 89b4af8..557868a 100644
--- a/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
+++ b/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
@@ -403,6 +403,7 @@ public class Player extends org.apache.avro.specific.SpecificRecordBase implemen
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public Player build() {
       try {
         Player record = new Player();
@@ -417,16 +418,18 @@ public class Player extends org.apache.avro.specific.SpecificRecordBase implemen
     }
   }
 
-  private static final org.apache.avro.io.DatumWriter
-    WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumWriter<Player>
+    WRITER$ = (org.apache.avro.io.DatumWriter<Player>)MODEL$.createDatumWriter(SCHEMA$);
 
   @Override public void writeExternal(java.io.ObjectOutput out)
     throws java.io.IOException {
     WRITER$.write(this, SpecificData.getEncoder(out));
   }
 
-  private static final org.apache.avro.io.DatumReader
-    READER$ = MODEL$.createDatumReader(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumReader<Player>
+    READER$ = (org.apache.avro.io.DatumReader<Player>)MODEL$.createDatumReader(SCHEMA$);
 
   @Override public void readExternal(java.io.ObjectInput in)
     throws java.io.IOException {

http://git-wip-us.apache.org/repos/asf/avro/blob/4810d48c/lang/java/tools/src/test/compiler/output/Player.java
----------------------------------------------------------------------
diff --git a/lang/java/tools/src/test/compiler/output/Player.java b/lang/java/tools/src/test/compiler/output/Player.java
index bfd3d07..589ec2a 100644
--- a/lang/java/tools/src/test/compiler/output/Player.java
+++ b/lang/java/tools/src/test/compiler/output/Player.java
@@ -403,6 +403,7 @@ public class Player extends org.apache.avro.specific.SpecificRecordBase implemen
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public Player build() {
       try {
         Player record = new Player();
@@ -417,16 +418,18 @@ public class Player extends org.apache.avro.specific.SpecificRecordBase implemen
     }
   }
 
-  private static final org.apache.avro.io.DatumWriter
-    WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumWriter<Player>
+    WRITER$ = (org.apache.avro.io.DatumWriter<Player>)MODEL$.createDatumWriter(SCHEMA$);
 
   @Override public void writeExternal(java.io.ObjectOutput out)
     throws java.io.IOException {
     WRITER$.write(this, SpecificData.getEncoder(out));
   }
 
-  private static final org.apache.avro.io.DatumReader
-    READER$ = MODEL$.createDatumReader(SCHEMA$);
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumReader<Player>
+    READER$ = (org.apache.avro.io.DatumReader<Player>)MODEL$.createDatumReader(SCHEMA$);
 
   @Override public void readExternal(java.io.ObjectInput in)
     throws java.io.IOException {


[2/2] avro git commit: AVRO-1914: Fix licencing errors reported by rat.

Posted by ni...@apache.org.
AVRO-1914: Fix licencing errors reported by rat.


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/27cb9e27
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/27cb9e27
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/27cb9e27

Branch: refs/heads/master
Commit: 27cb9e271715b00ff5784164a9fb02de00e57203
Parents: 4810d48
Author: Niels Basjes <nb...@bol.com>
Authored: Thu Sep 15 10:19:52 2016 +0200
Committer: Niels Basjes <nb...@bol.com>
Committed: Thu Sep 15 10:19:52 2016 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |  2 ++
 .../avro/specific/TestSpecificLogicalTypes.java    | 17 +++++++++++++++++
 .../avro/specific/TestSpecificToFromByteArray.java | 17 +++++++++++++++++
 pom.xml                                            |  4 +++-
 4 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/27cb9e27/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 365c6bd..aa72209 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -58,6 +58,8 @@ Trunk (not yet released)
 
     AVRO-1913: No warnings in the generated Java code. (Niels Basjes)
 
+    AVRO-1914: Fix licencing errors reported by rat. (Niels Basjes)
+
 Avro 1.8.1 (14 May 2016)
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/avro/blob/27cb9e27/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java
index 2b93717..64d45cb 100644
--- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java
+++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.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.specific;
 
 import org.apache.avro.Conversions;

http://git-wip-us.apache.org/repos/asf/avro/blob/27cb9e27/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificToFromByteArray.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificToFromByteArray.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificToFromByteArray.java
index b17cad2..d3a81c3 100644
--- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificToFromByteArray.java
+++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificToFromByteArray.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.specific;
 
 import org.apache.avro.Conversions;

http://git-wip-us.apache.org/repos/asf/avro/blob/27cb9e27/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0e5948a..4d1454a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -226,7 +226,7 @@
                 <!-- may not be in the root folder if using git-svn -->
                 <exclude>**/.git/**</exclude>
                 <exclude>**/.gitignore</exclude>
-                <!-- build or test files -->
+                <!-- build or test files (some are generated files that we commit as-is for testing purposes) -->
                 <exclude>**/*.log</exclude>
                 <exclude>build/**</exclude>
                 <exclude>doc/build/**</exclude>
@@ -245,6 +245,8 @@
                 <exclude>lang/ruby/.gem/**</exclude>
                 <exclude>lang/ruby/pkg/**</exclude>
                 <exclude>lang/ruby/.bundle/**</exclude>
+                <exclude>lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java</exclude>
+                <exclude>lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithoutLogicalTypes.java</exclude>
                 <exclude>lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java</exclude>
                 <exclude>lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Position.java</exclude>
                 <exclude>lang/java/tools/src/test/compiler/output/Player.java</exclude>