Hi,

In my opinion it would be nice if all the methods do the same for the same
null or empty string input and would be consistent, but...
I won't change the existing API in the current 3.x version.
So I think we should fix them only in 4.0.
However, we should fix it in the Strings class, before it is released to
start the unifying.

For the unified behavior, I think either
- null for null and "" for ""
- "" for null or ""

Regards,
David

Gary Gregory <garydgreg...@gmail.com> ezt írta (időpont: 2024. dec. 4.,
Sze, 12:46):

> Hi all,
>
> The StringUtils methods return a mix of null and "" for each method on null
> input. Each method does one of the following:
>
> - null out for null in
> - "" out for null in
> - null for null and "" for ""
> - throw an NPE
>
> The newer class Strings does the same as it backs StringUtils.
>
> Should we:
> - leave it alone in 3.x
> - normalize output to "" for null input
> - normalize output to null for null input
> - something else
> - do something only in 4.0
> - clean up only the Strings class (not released yet)
>
> Wdyt?
>
> TY,
> Gary
>

Reply via email to