-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b51
-
generic
-
generic
Doug Lea writes,
"DelayQueue.peek's javadoc/spec was wrong. It said that it would return
null if there are no unexpired elements (like poll). But unlike poll,
it does, and was intended to allow you to look at unexpired first
element.
Maurice Naftalin, who is writing generics book with Phil Wadler
pointed this out to me.
The underlying reason is that we had argued
about which way this should go, and ended up with the spec
saying one thing and the code doing the other. Moral: Never argue
(And worse, the tck test was broken, so allowed either. Also fixed.)
/**
* Retrieves, but does not remove, the head of this queue,
* or returns <tt>null</tt> if this queue is empty.
* Unlike <tt>poll</tt>, this method can be used to inspect
* elements that have not yet expired.
*
* @return the head of this queue, or <tt>null</tt> if this
* queue is empty.
*/
"
###@###.### 2005-06-11 21:32:26 GMT
"DelayQueue.peek's javadoc/spec was wrong. It said that it would return
null if there are no unexpired elements (like poll). But unlike poll,
it does, and was intended to allow you to look at unexpired first
element.
Maurice Naftalin, who is writing generics book with Phil Wadler
pointed this out to me.
The underlying reason is that we had argued
about which way this should go, and ended up with the spec
saying one thing and the code doing the other. Moral: Never argue
(And worse, the tck test was broken, so allowed either. Also fixed.)
/**
* Retrieves, but does not remove, the head of this queue,
* or returns <tt>null</tt> if this queue is empty.
* Unlike <tt>poll</tt>, this method can be used to inspect
* elements that have not yet expired.
*
* @return the head of this queue, or <tt>null</tt> if this
* queue is empty.
*/
"
###@###.### 2005-06-11 21:32:26 GMT