thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dongjin2193.jeon (Jira)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-5141) thrift writes malformed java codes when generating union with "reuse-objects" option
Date Mon, 16 Mar 2020 07:23:00 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-5141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060002#comment-17060002
] 

dongjin2193.jeon commented on THRIFT-5141:
------------------------------------------

this problem also occured in tupleSchemeReadValue.

> thrift writes malformed java codes when generating union with "reuse-objects" option
> ------------------------------------------------------------------------------------
>
>                 Key: THRIFT-5141
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5141
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.9.3
>            Reporter: dongjin2193.jeon
>            Priority: Major
>
> I ran thrfit  command with options "--gen java:reuse-objects" .
> As a result a variable was generated with no initializing.
> There are sample codes bellow.
> I got a compile error that "error: variable put might not have been initialized" 
> {code:java}
> // code placeholder
> @Override
>  protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot,
org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
>  _Fields setField = _Fields.findByThriftId(field.id);
> if (setField != null) {
> switch (setField) {
> case PUT:
>     if (field.type == PUT_FIELD_DESC.type) {
>     TPut put;
>     if (put == null) {
>         put = new TPut();
>     }
>     put.read(iprot);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message