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

PriorityBlockingQueue constructor spec typo

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17
    • core-libs
    • None
    • behavioral
    • minimal
    • 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.
    • Java API

      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

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

              Created:
              Updated:
              Resolved: