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

Sylwester Lachiewicz resolved THRIFT-1836.
------------------------------------------
    Resolution: Fixed

The Java generator emits the parameterized all-fields constructor as standard 
behavior (constructor generation in 
[compiler/cpp/src/thrift/generate/t_java_generator.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_java_generator.cc]).
 Resolving as Fixed.

> 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
>            Priority: Major
>         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 was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to