cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: [Kernel2.2] Remove nulls?
Date Wed, 31 Mar 2004 12:12:20 GMT
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

Mime
View raw message