commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stanley,Michael P." <mstan...@mitre.org>
Subject RE: [JAXL & JELLY] size() behavior question
Date Thu, 06 Mar 2003 20:41:33 GMT
I would be happy to supply this patch.  Choose your flavor...

> -----Original Message-----
> From: Stanley,Michael P. [mailto:mstanley@mitre.org]
> Sent: Tuesday, March 04, 2003 11:18 AM
> To: 'Jakarta Commons Developers List'
> Subject: RE: [JAXL & JELLY] size() behavior question
> 
> [snip]
> >
> > or should size() not throw an exception but return something like
-1?
> > I'm not a fan of such sloppyness, but wouldn't -1 make sense so you
> > could test size() > 0 w/o fear?
> 
> Well - the question is should size() be null safe?  Some possible
> options
> 
> 1: make size() null safe by making size(null) == -1 or size(null) == 0
> 2: add a new function nullSafeSize(null) with behaves the same as
above
> 3: add a new function size(object val, Boolean nullSafe) so size(null)
> web be the same as size(null, false) and throw an exception or
> size(null, true) == -1 or 0
> 
> It's a design choice.  I like option 3.
> 
> - Mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org



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


Mime
View raw message