Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.10
-
None
Description
Method calls such as StringUtils.newStringIso8859_1(null) should return null, not NPE.
It looks like this capability was lost with the fix for CODEC-136, i.e.
http://svn.apache.org/viewvc?rev=1306366&view=rev
Several methods were changed from
return StringUtils.newString(bytes, CharEncoding.xxx); to return new String(bytes, Charsets.xxx);
The new code should have been:
return newString(bytes, Charsets.xxx);
The newString method handles null input.
There were no tests for null input so the change in behaviour was missed.