[concurrency-interest] Collection.contains(E)

David Holmes dcholmes at optusnet.com.au
Tue Apr 17 02:46:11 EDT 2007


Dhanji,

Unimplemented optional methods do throw UnsupportedOperationException.

We're discussing optional exceptions on methods (where the method itself may
or may not be optional).

Cheers,
David

 -----Original Message-----
From: Dhanji R. Prasanna [mailto:dhanji at gmail.com]
Sent: Tuesday, 17 April 2007 4:42 PM
To: dholmes at ieee.org
Cc: Martin Buchholz; concurrency-interest at cs.oswego.edu
Subject: Re: [concurrency-interest] Collection.contains(E)





  On 4/17/07, David Holmes <dcholmes at optusnet.com.au> wrote:
    The inference from which is that it was a mistake for
NullPointerException
    and ClassCastException to be optionally allowed on such query methods.

  Yea, and if it didnt support the optional method at all--it should be
throwing UnsupportedOperationException. Particularly in the case of
Collections implementations.

  Dhanji.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070417/a7a60193/attachment.html 


More information about the Concurrency-interest mailing list