I'd like to hold it off til after the release.

Just add to the TODO and let it lie. Else we'll be doing this all over the
place :)

Mainly I just want to get the null/NPE/IAE thing agreed upon and then
the main release pushed out.

While we're an API project, so not quite like many other projects, there
is a lot to be said for release-early/release-often, and we've been pretty
bad on that.

Hen

On Fri, 27 Sep 2002, Steven Caswell wrote:

> I'd like to add the following methods to StringUtils:
>
> String defaultString(Object obj) - behaves the same as
> defaultString(String), invoking toString() on the obj to return the
> string, or blank if obj is null
> String defaultString(Object obj, String defaultString) - same as
> defaultString(String, String), invoking toString() on the obj to return
> the string, or the defaultString value if obj is null
>
> A specific use case: I do lots of debug logging, many times logging
> results from various method calls, some of which may not be null-safe.
> In cases where a method return could be null, I need to check the return
> for null and replace what would be logged with some placeholder string
> (i.e., "(null)". So the following code would be replace:
>
> debugLog.debug( "MyClass.myMethod() = " + ((MyClass.myMethod() == null)
> ? "(null)" : MyClass.myMethod().toString() + ")" );
>
> with
>
> debugLog.info( "MyClass.myMethod() = " +
> StringUtils.defaultString(MyClass.myMethod(), "(null"));
>
> I could use StringUtils.defaultString now if the result were a string,
> but for non-String objects where is no equivalent. I don't want to use
> StringUtils.defaultString(MyClass.myMethod().toString(), "(null)")
> because I'll get an NPE on the .toString() and defaultString will never
> have a chance.
>
> Would this hold up the imminent release? If so I'll defer to afterward.
>
> Steven Caswell
> [EMAIL PROTECTED]
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to