avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sachin Goyal (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AVRO-1648) @Union annotation cannot handle the class on which its used
Date Sat, 07 Mar 2015 00:07:38 GMT
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)

Mime
View raw message