> -----Original Message-----
> From: Stephen Colebourne [mailto:[EMAIL PROTECTED]
> I think that the basic request here is for a version of
> StringUtils that
> throws NPE on null input.

How about either:

* StringUtils becomes an instance class that is configured at
construction time:

    StringUtils utils = new StringUtils(someConfigurationObject);

  ...where the configuration object tells the new instance whether to
throw NullPointerExceptions, whether to treat zero-length strings and
all-whitespace strings in the same manner, etc., etc.

* StringUtils has a static method on it that configures the class in one
fell swoop (like above, but instead of a constructor)

* StringUtils has many fine-grained static configuration methods, so you
might do this:

    StringUtils.setThrowNullPointerExceptions(true);
    StringUtils.setTrimBeforeTests(true);
    StringUtils.setSomethingElseContentious(true);

Cheers,
Laird


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

Reply via email to