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

UnmodifiableNavigableSet can be modified by pollFirst() and pollLast()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.4
    • 4.5.0-M1
    • Collection, Set
    • None

    Description

      pollFirst() and pollLast() are successfully executed and do not throw an UnsupportedOperationException on an UnmodifiableNavigableSet instance.

      In my opinion, org.apache.commons.collections4.set.UnmodifiableNavigableSet should have an implementation similar to java.util.Collections.UnmodifiableNavigableSet, where both methods throw an UnsupportedOperationException: https://github.com/openjdk/jdk/blob/708407eddc9d52c01de02e3986c05e1c6225fa85/src/java.base/share/classes/java/util/Collections.java#L1278-L1279

      This was detected during working on https://github.com/assertj/assertj-core/pull/2328.

      Attachments

        Activity

          People

            kinow Bruno P. Kinoshita
            scordio Stefano Cordio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m