Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5029031
Votes 0
Synopsis (coll) JDK1.5 The method Collections.checkedQueue(Queue<T>,Class) is missing
Category java:classes_util
Reported Against tiger-beta
Release Fixed
State 7-Fix in Progress, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 08-APR-2004
Description


A DESCRIPTION OF THE REQUEST :
In JDK1.5 beta, in the package << java.util >> ; these methods were added, in the class java.util.Collections :

- public static <E> Collection<E> checkedCollection(Collection<E> c, Class<E> type);
- public static <E> SortedSet<E> checkedSortedSet(SortedSet<E> s,Class<E> type);
- public static <E> List<E> checkedList(List<E> list,Class<E> type);
- public static <K,V> Map<K,V> checkedMap(Map<K,V> m,Class<K> keyType,Class<V> valueType);
- public static <K,V> SortedMap<K,V> checkedSortedMap(SortedMap<K,V> m,Class<K> keyType,Class<V> valueType)

But this one is missing :
- public static <E> Queue<E> checkedQueue(Queue<E> list,Class<E> type);
java.util.Queue is a new interface for a collection.


JUSTIFICATION :
  Justification : scalability ?

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -

Queue<String> myCheckedQueue = Collections.checkedQueue( new PriorityQueue(), String.class );
(Incident Review ID: 246800) 
======================================================================
Posted Date : 2005-08-10 05:36:32.0
Work Around
N/A
Evaluation
This is an unintentional oversight, and should be added.  Ideally it should be added in Tiger (at the same time as the Queue interface is added to the platform).  In fact, we should have CheckedBlockingQueue as well.  This will cause an unfortunate dependency of java.util on java.util.concurrent, but c'est la vie.

  xxxxx@xxxxx   2004-04-13

Soon there'll be deques, navigablesets, blocking queues and blocking deques as well.
Each new collection class exacts a cost.
  xxxxx@xxxxx   2005-05-12 03:05:11 GMT
Contribution forum : https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?forumID=1463&messageID=20658
Posted Date : 2007-07-17 01:53:02.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang