You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Sachin Goyal (JIRA)" <ji...@apache.org> on 2015/03/07 01:07:38 UTC

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

Sachin Goyal created AVRO-1648:
----------------------------------

             Summary: @Union annotation cannot handle the class on which its used
                 Key: AVRO-1648
                 URL: https://issues.apache.org/jira/browse/AVRO-1648
             Project: Avro
          Issue Type: Bug
    Affects Versions: 1.7.7
            Reporter: Sachin Goyal


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
(v6.3.4#6332)