Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-756

CollectionUtils.filter(..) broken with blank Collections.singleton

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 4.4
    • Fix Version/s: None
    • Component/s: Collection
    • Labels:
      None

      Description

      When using CollectionUtils.filter(..), if the passed collection is initialized with jdk Collections.singleton(..) and only contains an isBlank(..) string, the method will throw an exception instead of removing blank item as expected. Tested with commons-collections:4.4 and java8.

      All can be resumed with

      CollectionUtils.filter(Collections.singleton(" "), StringUtils::isNotBlank); 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              noname713705 noname713705
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: