You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/05/01 23:29:30 UTC

[jira] Created: (THRIFT-477) remove extra methods generated for collections

remove extra methods generated for collections
----------------------------------------------

                 Key: THRIFT-477
                 URL: https://issues.apache.org/jira/browse/THRIFT-477
             Project: Thrift
          Issue Type: Improvement
          Components: Compiler (Java)
    Affects Versions: 0.1
            Reporter: Bryan Duxbury
            Priority: Trivial


For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 

Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743084#action_12743084 ] 

Bryan Duxbury commented on THRIFT-477:
--------------------------------------

What about making the old behavior accessible by a compiler switch?

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

Jarski commented on THRIFT-477:
-------------------------------

I support what David suggests - turn on the *new* behavior with a compiler switch. The reasoning behind this: the putToX() and addToX() methods are useful enough in their own right (and not just redundant code), that they could be useful for new projects using thrift. If it was a non-default these would probably go undiscovered.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761375#action_12761375 ] 

Mathias Herberts commented on THRIFT-477:
-----------------------------------------

This is issue is marked fixed despite the latest comments by Jarski requesting the rollback of those methods, what is its status?

I'm convinced too that those methods render the code using Thrift cleaner and smaller as they take care of field initialization.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Assigned: (THRIFT-477) remove extra methods generated for collections

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

Bryan Duxbury reassigned THRIFT-477:
------------------------------------

    Assignee: Bryan Duxbury

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Reopened: (THRIFT-477) remove extra methods generated for collections

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

Bryan Duxbury reopened THRIFT-477:
----------------------------------

      Assignee:     (was: Bryan Duxbury)

I rolled back the changes.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

David Reiss commented on THRIFT-477:
------------------------------------

These methods were in the original Javabean patches, contributed by Dave Engberg.  If he doesn't want them, I'm fine with dropping them.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Priority: Trivial
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Resolved: (THRIFT-477) remove extra methods generated for collections

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

Todd Lipcon resolved THRIFT-477.
--------------------------------

    Resolution: Invalid

resolving invalid since these changes were rolled back prior to 0.2 release

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Resolved: (THRIFT-477) remove extra methods generated for collections

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

Bryan Duxbury resolved THRIFT-477.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2

Since there was never any response from Dave Engberg, I am assuming he is no longer following Thrift. As such, I committed this. 

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

David Reiss commented on THRIFT-477:
------------------------------------

If people find them useful, I think we should add them back.  The cost of having them is minimal.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Updated: (THRIFT-477) remove extra methods generated for collections

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

Bryan Duxbury updated THRIFT-477:
---------------------------------

    Attachment: thrift-477.patch

This patch removes the special extra methods for collections. What do people think about committing this?

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Priority: Trivial
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

David Reiss commented on THRIFT-477:
------------------------------------

I'm okay with it if Dave Engberg is.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

David Reiss commented on THRIFT-477:
------------------------------------

What about making the new behavior accessible by a compiler switch?

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

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

Jarski commented on THRIFT-477:
-------------------------------

Sorry for not noticing this discussion earlier, but our company just upgraded thrift and it turns out we were relying heavily on this. Do you guys object if we keep these, so that we don't have to un-patch this for our internal compiler builds? The redundant BlahSize() methods we don't care much for either, but the putToX() and addToX() methods were particularly useful since they do a null check + automatically instantiate the corresponding collection if it doesn't exist.

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Updated: (THRIFT-477) remove extra methods generated for collections

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

Bryan Duxbury updated THRIFT-477:
---------------------------------

    Patch Info: [Patch Available]

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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


[jira] Commented: (THRIFT-477) remove extra methods generated for collections

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714665#action_12714665 ] 

Bryan Duxbury commented on THRIFT-477:
--------------------------------------

Does the elusive Dave Engberg read the mailing list?

> remove extra methods generated for collections
> ----------------------------------------------
>
>                 Key: THRIFT-477
>                 URL: https://issues.apache.org/jira/browse/THRIFT-477
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Trivial
>         Attachments: thrift-477.patch
>
>
> For some reason, the java generator produces a bunch of extra methods whenever you have a field of a collection type. For instance if you have a field called "my_list", then you will get a "get_my_list_size()" method in addition to the standard getter and setter. 
> Personally I find these extra methods redundant, since all they save you is a pair of parentheses. I'd prefer to just get rid of them. Does anyone out there like or use these methods?

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