AVRO-2115: Java: Permit @Union annotations on fields of classes. Contributed by Miguel Martinez-Espronceda.
Project: http://git-wip-us.apache.org/repos/asf/avro/repo Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/5040c641 Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/5040c641 Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/5040c641 Branch: refs/heads/master Commit: 5040c6413b112665cd051c415f368f9a51426b97 Parents: ff5099c 53a9af7 Author: Doug Cutting <[email protected]> Authored: Mon Dec 18 10:01:47 2017 -0800 Committer: Doug Cutting <[email protected]> Committed: Mon Dec 18 10:01:47 2017 -0800 ---------------------------------------------------------------------- CHANGES.txt | 4 +++ .../org/apache/avro/reflect/ReflectData.java | 4 +++ .../java/org/apache/avro/reflect/Union.java | 5 ++-- .../java/org/apache/avro/reflect/package.html | 2 +- .../org/apache/avro/reflect/TestReflect.java | 28 ++++++++++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/avro/blob/5040c641/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index d23a5bb,a621c65..008e230 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -3,6 -3,6 +3,7 @@@ Avro Change Lo Trunk (not yet released) INCOMPATIBLE CHANGES ++ AVRO-2003: Report specific location of schema incompatibilities (teabot via nkollar) AVRO-2035: Java: validate default values when parsing schemas. (cutting) @@@ -90,15 -90,6 +91,18 @@@ AVRO-2055: Remove Magic Value From org.apache.avro.hadoop.io.AvroSequenceFile (Beluga Behr via gabor) + AVRO-1047: Remaining warnings in generated Java code exposed by -Xlint:all fixed. + (Michael Werle via Niels Basjes) + + AVRO-2080: Fix Javadoc Warnings in Generated Records + (Bridger Howell via Niels Basjes) + + AVRO-2114: Make missing value exceptions in nested structures easier to read. + (Niels Basjes) + ++ AVRO-2115: Java: Permit @Union annotations on fields of classes. ++ (Miguel Martinez-Espronceda via cutting). ++ BUG FIXES AVRO-1741: Python3: Fix error when codec is not in the header. http://git-wip-us.apache.org/repos/asf/avro/blob/5040c641/lang/java/avro/src/main/java/org/apache/avro/reflect/Union.java ---------------------------------------------------------------------- diff --cc lang/java/avro/src/main/java/org/apache/avro/reflect/Union.java index b22fa66,8f9f276..e192ffa --- a/lang/java/avro/src/main/java/org/apache/avro/reflect/Union.java +++ b/lang/java/avro/src/main/java/org/apache/avro/reflect/Union.java @@@ -28,10 -28,11 +28,11 @@@ import java.lang.annotation.Target * May be used for base classes or interfaces whose instantiable subclasses can * be listed in the parameters to the @Union annotation. If applied to method * parameters this determines the reflected message parameter type. If applied - * to a method, this determines its return type. - * to a method, this determines its return type. A null schema may be specified ++ * to a method, this determines its return type. A null schema may be specified + * with {@link java.lang.Void}. */ @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.PARAMETER, ElementType.METHOD}) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) @Documented public @interface Union { /** The instantiable classes that compose this union. */
