On 31 Mar 2004, at 11:52, Gianugo Rabellino wrote:

I've seen in the new API that in a number of places there are contracts that return null if something isn't found: since these are all perfect candidates for nasty NPEs, how about switching to NullObject pattern or throw Exceptions instead?

As far as I can see, "null"s are returned only when implementing the collections interfaces (Library, Parameters, Configuration) or when URLs are resolved (Resolver).

And even there (ex. Configuration and Parameters) when calling a method specifed in the interface, and not inherited from the Set/Map/Collection, it will throw specific exceptions (ex. ConfigurationException).

Where did you notice it?

Just my 0.2c, but since we're talking foundations I think it could be a right time to be strict about code principles...

Absolutely!!!

Pier

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to