Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7042037

Make NavigableSet's contract permit immutable implementations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u24
    • core-libs

      A DESCRIPTION OF THE REQUEST :
      The contract for java.util.NavigableSet features two methods--pollFirst() and pollLast()--that are (a) destructive and (b) non-optional.

      It is not clear from the contract of this interface whether these methods may throw UnsupportedOperationException. Please clarify the contract, ideally to permit implementations of these methods to throw UnsupportedOperationException in accordance with all the other destructive operations of Collection interfaces (add, remove, retainAll, clear, etc.)

      JUSTIFICATION :
      It is currently impossible to create a NavigableSet implementation that is immutable and still honors the NavigableSet contract as written.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: