-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.7
-
Fix Version/s: 3.8
-
Component/s: None
-
Labels:None
-
External issue URL:
-
External issue ID:330
This is the sample code.
int max = Integer.MAX_VALUE; // 2147483647 WordUtils.wrap("foobar", max, "\n", true);
and the error log.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -2147483648 at java.lang.String.substring(String.java:1967) at org.apache.commons.lang3.text.WordUtils.wrap(WordUtils.java:291) at org.apache.commons.lang3.text.WordUtils.wrap(WordUtils.java:179)
Seems WordUtils in commons-text has the same bug. I will file it on commons-text side later.
- is cloned by
-
TEXT-123 WordUtils.wrap throws StringIndexOutOfBoundsException when wrapLength is Integer.MAX_VALUE
-
- Closed
-
- is related to
-
HADOOP-10783 apache-commons-lang.jar 2.6 does not support FreeBSD -upgrade to 3.x needed
-
- Resolved
-
- links to