You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Erik van Oosten (JIRA)" <ji...@apache.org> on 2013/01/21 10:00:19 UTC

[jira] [Updated] (THRIFT-1836) Java compiler does not generate constructor with all fields

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

Erik van Oosten updated THRIFT-1836:
------------------------------------

    Attachment: thrift-1836-additional-java-constructor.patch
    
> Java compiler does not generate constructor with all fields
> -----------------------------------------------------------
>
>                 Key: THRIFT-1836
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1836
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler
>    Affects Versions: 0.9
>            Reporter: Erik van Oosten
>         Attachments: thrift-1836-additional-java-constructor.patch
>
>
> The java compiler does not generate a constructor with all fields when some fields are required and some are optional. It only generates a constructor with all required fields, or a constructor with all fields when all fields are optional.
> Rationale: We currently do not specify the requiredness of any field (making them optional). If we change some of the fields to required, we also have to rewrite so much code that is no longer practical.
> The attached patch will generate 3 constructors instead of 2:
> - the default constructor
> - a constructor with all required fields
> - a constructor with all fields (added by this patch)

--
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