You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Gary Dusbabek (JIRA)" <ji...@apache.org> on 2009/12/04 16:08:20 UTC

[jira] Created: (THRIFT-641) --gen java no longer generates constructors with all required and optional args.

--gen java no longer generates constructors with all required and optional args.
--------------------------------------------------------------------------------

                 Key: THRIFT-641
                 URL: https://issues.apache.org/jira/browse/THRIFT-641
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (Java)
         Environment: Mac OS X, 
            Reporter: Gary Dusbabek
            Priority: Minor


--gen java only generates constructors that have the required members as parameters.  In the past it would generate constructors that had all members, including optional members.

E.g.:

struct ColumnParent {
   3: required string column_family,
   4: optional binary super_column,
}

generates:

 public ColumnParent(String column_family)
 {
   this();
   this.column_family = column_family;
 }

but historically generated:

public ColumnParent(String column_family, byte[] super_column)
 {
   this();
   this.column_family = column_family;
   this.super_column = super_column;
 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-641) --gen java no longer generates constructors with all required and optional args.

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785993#action_12785993 ] 

David Reiss commented on THRIFT-641:
------------------------------------

This is intentional.  See THRIFT-529

> --gen java no longer generates constructors with all required and optional args.
> --------------------------------------------------------------------------------
>
>                 Key: THRIFT-641
>                 URL: https://issues.apache.org/jira/browse/THRIFT-641
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>         Environment: Mac OS X, 
>            Reporter: Gary Dusbabek
>            Priority: Minor
>
> --gen java only generates constructors that have the required members as parameters.  In the past it would generate constructors that had all members, including optional members.
> E.g.:
> struct ColumnParent {
>    3: required string column_family,
>    4: optional binary super_column,
> }
> generates:
>  public ColumnParent(String column_family)
>  {
>    this();
>    this.column_family = column_family;
>  }
> but historically generated:
> public ColumnParent(String column_family, byte[] super_column)
>  {
>    this();
>    this.column_family = column_family;
>    this.super_column = super_column;
>  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-641) --gen java no longer generates constructors with all required and optional args.

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785997#action_12785997 ] 

Jonathan Ellis commented on THRIFT-641:
---------------------------------------

It would be better to have both constructor-with-requred-params and constructor-with-all-params, both to avoid screwing over projects using the latter and because it is simply better style in many cases than forcing setter use after construction.

> --gen java no longer generates constructors with all required and optional args.
> --------------------------------------------------------------------------------
>
>                 Key: THRIFT-641
>                 URL: https://issues.apache.org/jira/browse/THRIFT-641
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>         Environment: Mac OS X, 
>            Reporter: Gary Dusbabek
>            Priority: Minor
>
> --gen java only generates constructors that have the required members as parameters.  In the past it would generate constructors that had all members, including optional members.
> E.g.:
> struct ColumnParent {
>    3: required string column_family,
>    4: optional binary super_column,
> }
> generates:
>  public ColumnParent(String column_family)
>  {
>    this();
>    this.column_family = column_family;
>  }
> but historically generated:
> public ColumnParent(String column_family, byte[] super_column)
>  {
>    this();
>    this.column_family = column_family;
>    this.super_column = super_column;
>  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-641) --gen java no longer generates constructors with all required and optional args.

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss resolved THRIFT-641.
--------------------------------

    Resolution: Won't Fix

Let's move this discussion back to THRIFT-529 so all of the context is available, including why I wasn't so keen on the two-constructor option.

> --gen java no longer generates constructors with all required and optional args.
> --------------------------------------------------------------------------------
>
>                 Key: THRIFT-641
>                 URL: https://issues.apache.org/jira/browse/THRIFT-641
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>         Environment: Mac OS X, 
>            Reporter: Gary Dusbabek
>            Priority: Minor
>
> --gen java only generates constructors that have the required members as parameters.  In the past it would generate constructors that had all members, including optional members.
> E.g.:
> struct ColumnParent {
>    3: required string column_family,
>    4: optional binary super_column,
> }
> generates:
>  public ColumnParent(String column_family)
>  {
>    this();
>    this.column_family = column_family;
>  }
> but historically generated:
> public ColumnParent(String column_family, byte[] super_column)
>  {
>    this();
>    this.column_family = column_family;
>    this.super_column = super_column;
>  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.