[jira] [Commented] (COLLECTIONS-432) Replace Buffer interface with java.util.Queue

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COLLECTIONS-432) Replace Buffer interface with java.util.Queue

Otto Fowler (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13604702#comment-13604702 ]

Thomas Neidhart commented on COLLECTIONS-432:
---------------------------------------------

Applied changes in r1457501.
I kept the UnmodifiableQueue decorator as there is not real counterpart in the JDK.

For the release-notes:

 * PriorityBuffer -> use PriorityQueue or PriorityBlockingQueue
 * SynchronizedBuffer -> use the corresponding *BlockingQueue classes
 * BlockingBuffer -> use the corresponding *BlockingQueue classes
 * BoundedBuffer -> use either ArrayBlockingBuffer(capacity) or LinkedBlockingBuffer(capacity)
 * UnboundedFifoBuffer -> use either LinkedList or LinkedBlockingBuffer

ArrayStack can not yet be removed as we still target Java 1.5, but it is marked as deprecated now.
CircularFifoQueue could still be useful as a separate implementation, tbd
Extensions to CollectionUtils.isFull/maxSize is still tbd
               

> Replace Buffer interface with java.util.Queue
> ---------------------------------------------
>
>                 Key: COLLECTIONS-432
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-432
>             Project: Commons Collections
>          Issue Type: Sub-task
>    Affects Versions: 4.0
>            Reporter: Thomas Neidhart
>            Priority: Blocker
>             Fix For: 4.0
>
>         Attachments: commons.patch
>
>
> Since jdk 1.5, a new interface Queue is available which is basically identical to the Buffer interface of CC.
> Some of our implementations already have a counterpart in the jdk:
> * BoundedFifoBuffer -> LinkedBlockingQueue or ArrayBlockingQueue
> * UnboundedFifoBuffer -> LinkedList or ArrayDeque
> * PriorityBuffer -> PriorityQueue
> Thus the Buffer queue shall be replaced by the existing Queue, unneeded implementations be removed and the rest adapted.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira