You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jarski (JIRA)" <ji...@apache.org> on 2009/08/14 03:28:14 UTC
[jira] Commented: (THRIFT-477) remove extra methods generated for
collections
[ 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.