commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collection] Collections for primitives
Date Tue, 25 Jun 2002 19:06:22 GMT
From: "Michael A. Smith" <mas@apache.org>
> If you are implementing a library of some sort that accepts a List as an
> argument without knowing whether there are object eligibility
> restrictions (checkForFriendlyLists), you'd have to abide by the List
> contract completely and expect ClassCastExceptions.  So you're shifting
> the bug.  Why would that library assume it knows what is allowed in the
> collection when the List contract clearly states that some Lists don't
> allow any Object to be passed into its methods as arguments.

I guess the straight answer is that I think the List contract is wrong ;-)
Exception handling is overkill in this case because there is a valid return
value to indicate the same thing.

Of course, I can't argue against the List contract. So I'll have to let this
stand as being within the contract. But I don't think its what most users
will expect.

Stephen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message