avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Taton (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1300) Copy-constructor for specific record builders: Builder(Builder other) does not copy the fields from builder "other"
Date Thu, 18 Apr 2013 17:42:13 GMT

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

Christophe Taton updated AVRO-1300:
-----------------------------------

    Attachment: AVRO-1300.20130418-104121.patch

Here is a patch that implements the copy-constructor for the specific builders.
                
> Copy-constructor for specific record builders: Builder(Builder other) does not copy the
fields from builder "other"
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1300
>                 URL: https://issues.apache.org/jira/browse/AVRO-1300
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Christophe Taton
>         Attachments: AVRO-1300.20130418-104121.patch
>
>
> Here is a test that fails:
>   @Test
>   public void test() {
>     final Player.Builder builder = Player.newBuilder()
>         .setFirstName("FirstName");
>     final Player.Builder other = Player.newBuilder(builder);
>     Assert.assertEquals("FirstName", other.getFirstName());
>   }
> The generated code looks like:
>   /** Creates a new Player RecordBuilder by copying an existing Builder */
>   public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player.Builder
other) {
>     return new avro.examples.baseball.Player.Builder(other);
>   }
>   /** Creates a Builder by copying an existing Builder */
>   private Builder(avro.examples.baseball.Player.Builder other) {
>     super(other);  // calls SpecificRecordBuilderBase(SpecificRecordBuilderBase<T>
other)
>   }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message