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

        Stephen Kestle created issue -
        Stephen Kestle made changes -
        Field Original Value New Value
        Attachment CollectionUtils select return.patch [ 12337131 ]
        Stephen Colebourne made changes -
        Affects Version/s 2.1.1 [ 12311992 ]
        Component/s Collection [ 12311226 ]
        Affects Version/s Nightly Builds [ 12311784 ]
        Affects Version/s 3.1 [ 12311687 ]
        Affects Version/s 2.1 [ 12311750 ]
        Affects Version/s 1.0 [ 12311812 ]
        Affects Version/s 2.0 [ 12311825 ]
        Component/s Core [ 12311222 ]
        Affects Version/s 3.3 [ 12311987 ]
        Affects Version/s 3.0 [ 12311787 ]
        Assignee Stephen Colebourne [ scolebourne ]
        Stephen Colebourne made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]
        Stephen Colebourne made changes -
        Resolution Won't Fix [ 2 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Stephen Colebourne made changes -
        Fix Version/s Generics [ 12312131 ]
        Stephen Kestle made changes -
        Assignee Stephen Colebourne [ scolebourne ] Stephen Kestle [ shammah ]
        Matt Benson made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Henri Yandell made changes -
        Fix Version/s 3.3 [ 12311987 ]
        Fix Version/s Generics [ 12312131 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12376364 ] Default workflow, editable Closed status [ 12607271 ]
        Thomas Neidhart made changes -
        Fix Version/s 4.0 [ 12314511 ]
        Fix Version/s 4.0-beta-1 [ 12311987 ]
        Thomas Neidhart made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Thomas Neidhart made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Thomas Neidhart made changes -
        Fix Version/s 4.0-alpha1 [ 12324645 ]
        Thomas Neidhart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development