commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Kestle (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (COLLECTIONS-223) CollectionUtils.addAll() methods should return the input collection
Date Thu, 13 Sep 2007 00:02:32 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526949
] 

shammah edited comment on COLLECTIONS-223 at 9/12/07 5:01 PM:
---------------------------------------------------------------------

I've updated the CollectionUtils.addAll() methods to return non-void parameters (apart from
1 - I'll get to that).

However, I forgot about this ticket and it's usefulness, and made the return type boolean
(whether the collection has changed or not).  Both options are useful, but I'd lean towards
wanting the collection back rather than the boolean.

Perhaps if addAll returns the collection (since we're in *Collection*Utils), and we have addAllReturnChanged
for booleans?  I can't think of a good name for it right now...

      was (Author: shammah):
    I've updated the CollectionUtils.addAll() methods to return non-void parameters (apart
from 1 - I'll get to that).

However, I forgot about this ticket and it's usefulness, and made the return type boolean
(whether the collection has changed or not).  Both options are useful, but I'd lean towards
wanting the collection back rather than the boolean.

Perhaps if addAll returns the collection (since we're in *Collection* Utils), and we have
addAllReturnChanged for booleans?  I can't think of a good name for it right now...
  
> CollectionUtils.addAll() methods should return the input collection
> -------------------------------------------------------------------
>
>                 Key: COLLECTIONS-223
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-223
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Vasily Ivanov
>            Priority: Minor
>             Fix For: 4.0
>
>
> Like MapUtils.putAll() method returns input map, CollectionUtils.addAll() methods should
return the input collection.
> This will allow to init and populate collection at the same line:
> ArrayList inputs = (ArrayList) CollectionUtils.addAll(new ArrayList(), new String[] {
"value1", "value2" });

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


Mime
View raw message