Commons Collections
  1. Commons Collections
  2. COLLECTIONS-218

CollectionUtils.select() does not return passed in collection

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: Core
    • Labels:
      None

      Description

      collect has the following methods:

      Collection collect(Collection inputCollection, final Transformer transformer)
      Collection collect(Collection inputCollection, final Transformer transformer, final Collection outputCollection)

      The first creates an ArrayList(), where the second takes an outputCollection and, for convenience, returns it.

      Select (and selectReject) currently the following methods:

      Collection select(Collection inputCollection, Predicate predicate)
      void select(Collection inputCollection, Predicate predicate, Collection outputCollection)

      I propose changing the bottom method to return the passed in outputCollection. It would simplify calling code.

        Activity

          People

          • Assignee:
            Stephen Kestle
            Reporter:
            Stephen Kestle
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development