Collections.checkedQueue() offer method should not call add.

Jason Mehrens jason_mehrens at
Mon Oct 31 18:08:18 UTC 2011

CheckedQueue.offer should call 'this.queue.offer' instead of 'this.add'.  If you pass a Queue with bounded capacity (ArrayBlockingQueue) the CQ.offer method should return false when the queue is full but will instead throw an IllegalStateException.  The current version also is performing the type check twice.
Changeset: c5c91589b126
Author:    mduigou
Date:      2011-10-19 14:17 -0700

5029031: Add Collections.checkedQueue()
Reviewed-by: mduigou
Contributed-by: darryl.mocek at

! src/share/classes/java/util/
+ test/java/util/Collections/


More information about the core-libs-dev mailing list