The comments at http://raibledesigns.com/comments/rd/minimal/commons_lang_stringutils are a good reason for how surprisingly nice people find isEmpty.
On Fri, 18 Jul 2003, Stephen Colebourne wrote: > Proposal for methods: > > - isEmpty() - true for "" or null > - isNotEmpty() - opposite > - isEmptyNN() - true for "" +1. Especially +1 for isEmpty retaining much the same functionality. > - isBlank() - trims - true for " ", "" or null > - isNotBlank() - opposite > - isBlankNN() - trims - true for " " or "" +1 I think this wording works. While I think people do expect isEmpty to be false for null, I don't think they expect it to go trimming on them usually. > - isWhitespace() - true for all whitespace, "" or null > - isNotWhitespace() - opposite > - isWhitespaceNN() - true for all whitespace or "" +1 > Where NN means NotNull. > This covers all the cases, and takes the working premise that more people > want null to be true than false. > > > Proposal for location: > 1) In StringUtils. Incompatable change to isEmpty() (no longer trims) and > isWhitespace() (null now true). +1 > 2) In StringTests (new class). Deprecate StringUtils isEmpty/isNotEmpty. -1. I don't think we want to overly confuse the issue with this yet. Breaking StringUtils up is a 3.0 thing if desired I believe. > I prefer the incompatable change #1. We are offering a simply named > alternative. Also, some people already don't expect isEmpty to trim. And > Tapestry and Turbine should both be OK. Agreed. Hen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
