Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F0FF6200BA9 for ; Sun, 23 Oct 2016 16:57:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EF751160AFC; Sun, 23 Oct 2016 14:57:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 69D76160AD8 for ; Sun, 23 Oct 2016 16:57:00 +0200 (CEST) Received: (qmail 56390 invoked by uid 500); 23 Oct 2016 14:56:59 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 56373 invoked by uid 99); 23 Oct 2016 14:56:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2016 14:56:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 662552C014E for ; Sun, 23 Oct 2016 14:56:59 +0000 (UTC) Date: Sun, 23 Oct 2016 14:56:59 +0000 (UTC) From: "Pascal Schumacher (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-1276) ArrayIndexOutOfBoundsException StrBuilder replace MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 23 Oct 2016 14:57:01 -0000 [ https://issues.apache.org/jira/browse/LANG-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pascal Schumacher updated LANG-1276: ------------------------------------ Summary: ArrayIndexOutOfBoundsException StrBuilder replace (was: [lang] ArrayIndexOutOfBoundsException StrBuilder replace) > ArrayIndexOutOfBoundsException StrBuilder replace > ------------------------------------------------- > > Key: LANG-1276 > URL: https://issues.apache.org/jira/browse/LANG-1276 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 3.2.1, 3.4, 3.5 > Reporter: Andreas Skomedal > Fix For: Patch Needed, 3.6 > > > 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 > {noformat} > 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) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)