classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [Bug #3872] Additional exceptions in java.util


From: Andrew John Hughes
Subject: Re: [cp-patches] [Bug #3872] Additional exceptions in java.util
Date: Thu, 29 Jul 2004 10:48:02 +0100

On Thu, 2004-07-29 at 10:23, Mark Wielaard wrote:
> Hi Andrew,
> 
> On Thu, 2004-07-29 at 09:42, Andrew John Hughes wrote:
> > The attached patch adds the exceptions introduced by 1.4
> > to the documentation of the interface methods in java.util.
> > Any additions to the normal and exception classes will follow.
> > Let me know if this is okay to commit.
> 
> Yes these clarifications look good to me.
> 
> It would be nice to add a little documentation which standard GNU
> Classpath collection classes don't accept null values (I guess that is
> only the retrofitted ones - Hashtable and Vector). And I assume a
> ClassCastException is only thrown my ArrayList and collection classes
> that implement SortedSet? If that is the correct interpretation then
> adding something like that to the Collections class API documentation
> would be nice.
> 
> Cheers,
> 
> Mark

Thanks, Mark.  I'll add any necessary documentation on accepted values
when looking at the classes, unless there is a particular reason for
commenting on the standard implementations in the interface.
Indeed, ClassCastException is thrown by some of the additional methods
in the sorted collections (the ones that handle comparisons).  However, 
AFAICS, the additions to the interfaces relate to allowing more freedom
in all collection implementations.  The additional exceptions would
allow a collection to reject null values or accept values only of a
certain type.  For example, you could effectively implement a growable
equivalent of an integer array by extending ArrayList, and only allowing
objects of type Integer to be added (throwing a ClassCastException for
non-Integers).

Cheers,
-- 
Andrew :-)
 
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
 
Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn.
 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]