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 Tue, 04 Mar 2003 16:18:20 GMT
[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


Mime
View raw message