You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2018/12/30 04:18:02 UTC

[jira] [Updated] (AVRO-1648) @Union annotation cannot handle the class on which its used

     [ https://issues.apache.org/jira/browse/AVRO-1648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiruvalluvan M. G. updated AVRO-1648:
--------------------------------------
    Component/s: java

> @Union annotation cannot handle the class on which its used
> -----------------------------------------------------------
>
>                 Key: AVRO-1648
>                 URL: https://issues.apache.org/jira/browse/AVRO-1648
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: Sachin Goyal
>            Priority: Major
>
> The bug is as shown in the following code:
> {code}
> // Having Base.class in the union results in infinite recursion
> @Union ({Base.class, Derived.class})
> // Having no Base.class in the union fails PolymorphicDO.obj2
> @Union ({Derived.class})
> private static class Base 
> {
>   Integer a = 5;
> }
> private static class Derived extends Base
> {
>   String b = "Foo";
> }
> private static class PolymorphicDO
> {
>   Base obj = new Derived();
>   Base obj2 = new Base();
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)