commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Skomedal (JIRA)" <>
Subject [jira] [Created] (LANG-1276) [lang] ArrayIndexOutOfBoundsException StrBuilder replace
Date Wed, 19 Oct 2016 10:17:59 GMT
Andreas Skomedal created LANG-1276:

             Summary: [lang] ArrayIndexOutOfBoundsException StrBuilder replace
                 Key: LANG-1276
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Andreas Skomedal

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");


java.lang.ArrayIndexOutOfBoundsException: 49
	at org.apache.commons.lang3.text.StrMatcher$StringMatcher.isMatch(
	at org.apache.commons.lang3.text.StrBuilder.replaceImpl(
	at org.apache.commons.lang3.text.StrBuilder.replace(
	at org.apache.commons.lang3.text.StrBuilder.replaceAll(

This message was sent by Atlassian JIRA

View raw message