commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35955] - [collections] Change CollectionUtils.forAllDo to return the Closure
Date Fri, 05 Aug 2005 22:53:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35955>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35955


james.cakalic@charter.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |




------- Additional Comments From james.cakalic@charter.net  2005-08-06 00:53 -------
You're right. It should have been:

    public BigDecimal getTotal() {
        return ((SumTotalClosure)CollectionUtils.forAllDo(lineItems, new
SumTotalClosure())).total();
    }

I still like that better. Or I could do (one possible variation):

    public BigDecimal getTotal() {
        return ((SumTotalClosure)sumItemTotals()).total();
    }

    private Closure sumItemTotals() {
        return CollectionUtils.forAllDo(lineItems, new SumTotalClosure());
    }

I don't see how backward compatibility and casting concerns "rule this out".
There is no backward compatibility problem -- forAllDo was previously void and
now it returns a value. Casting is my (the client's) problem, not a concern of
the collections package.

Jim

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message