Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.1, 3.4, 3.5
-
None
Description
There is a bug in replace for StrBuilder, seems the use of nonupdated buffer and character count is off.
new StrBuilder("Dear X, hello X.").replaceAll(StrMatcher.stringMatcher("X"), "012345678901234567");
yields
java.lang.ArrayIndexOutOfBoundsException: 49 at org.apache.commons.lang3.text.StrMatcher$StringMatcher.isMatch(StrMatcher.java:372) at org.apache.commons.lang3.text.StrBuilder.replaceImpl(StrBuilder.java:2115) at org.apache.commons.lang3.text.StrBuilder.replace(StrBuilder.java:2088) at org.apache.commons.lang3.text.StrBuilder.replaceAll(StrBuilder.java:2049)
Attachments
Issue Links
- links to