commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno Noordover (JIRA)" <>
Subject [jira] [Commented] (LANG-952) Inconsistent handling of empty string
Date Tue, 30 Dec 2014 19:44:16 GMT


Arno Noordover commented on LANG-952:

Doesn't seem very easy to implement a consistent logic.
e.g. isAlphaSpace should return isAlpha || isWhitespace. isWhitespace returns true for an
empty string so isAlphaSpace should return true as well.
And to be honest others might have another opinion about this.

> Inconsistent handling of empty string
> -------------------------------------
>                 Key: LANG-952
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.2.1
>            Reporter: Benedikt Ritter
>            Assignee: Benedikt Ritter
>             Fix For: 3.x
> As discussed on the ML ( and in LANG-823
some methods handle the empty string inconsistently. For example:
> {code:java}
> StringUtils.containsNone("", *) = StringUtils.containsOnly("", *) = true
> {code}
> In this example it makes no sense, that the empty string at the same time contains no
character and contains any character. There is no reason to treat the empty string specially.
It should be handled like an arbitrary string. It needs to be checked if there are more examples
for inconsistent empty string handling.

This message was sent by Atlassian JIRA

View raw message