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

PriorityBlockingQueue constructor spec typo

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Considering that no one had noticed this typo for many years, the only impact seems to be automated testing efforts that interpret specs to create tests.
    • Interface Kind:
      Java API

      Description

      Summary

      The spec for the copy constructor says that it uses argument's comparator if a PriorityQueue, but meant to say PriorityBlockingQueue.

      Problem

      The implementation of the copy constructor in fact uses the comparator of the argument if it's a PBQ but not if it's a PQ. This was almost surely a copy-paste error.

      Solution

      Adjust specification to match the implementation, by replacing "PriorityQueue" with "PriorityBlockingQueue".

      Specification

      Replace

       * in the specified collection.  If the specified collection is a
       * {@link SortedSet} or a {@link PriorityQueue}, this

      with

       * in the specified collection.  If the specified collection is a
       * {@link SortedSet} or a {@link PriorityBlockingQueue}, this

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dl Doug Lea
              Reporter:
              tvaleev Tagir Valeev
              Reviewed By:
              Martin Buchholz, Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: