[concurrency-interest] LinkedBlockingQueue does not throwClassCastException

David Holmes dcholmes at optusnet.com.au
Mon Apr 16 20:49:12 EDT 2007


If you check the documentation you will see that LinkedBlockingQueue.add is
inherited from AbstractQueue.add, and the latter does *not* throw
ClassCastException.

David Holmes

> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu
> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Szabolcs
> Ferenczi
> Sent: Tuesday, 17 April 2007 9:48 AM
> To: Hanson Char
> Cc: Concurrency-interest at cs.oswego.edu
> Subject: Re: [concurrency-interest] LinkedBlockingQueue does not
> throwClassCastException
>
>
> On 17/04/07, Hanson Char <hanson.char at gmail.com> wrote:
> > Ever considered the use of Collections.checkedCollection(Collection<E>,
> > Class<E>) ?  That will provide you with runtime type checking.
>
> No. My concern was to test class LinkedBlockingQueue against its
> documentation.
>
> Best Regards,
> Szabolcs
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list