commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1226) StringUtils#normalizeSpace does not trim the string anymore
Date Mon, 09 May 2016 12:52:12 GMT

    [ https://issues.apache.org/jira/browse/LANG-1226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15276319#comment-15276319
] 

Sebb commented on LANG-1226:
----------------------------

See LANG-1227 - any XML methods need to be sensitive to the XML spec version.
Maybe such methods belong in the XMLCharacter class.
StringUtils could have a wrapper that delegates to it.

e.g.

StringUtils.normalizeXmlSpace(String input, XMLCharacter#enum XML version) {
    return XMLCharacter.getInstance(version).normalizeSpace(input);
}

> StringUtils#normalizeSpace does not trim the string anymore
> -----------------------------------------------------------
>
>                 Key: LANG-1226
>                 URL: https://issues.apache.org/jira/browse/LANG-1226
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.4
>            Reporter: Pascal Schumacher
>
> These work with 3.3.2, but fail with 3.4:
> {code}
> assertEquals("b", StringUtils.normalizeSpace("\u0000b"));
> assertEquals("b", StringUtils.normalizeSpace("b\u0000"));
> {code}
> Java doc still says "... Additionally #trim(String)} removes control characters (char
&lt;= 32) from both ends of this String."



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message