Bug 36106 - RE.subst() throws IndexOutOfBoundsException with back-references
Summary: RE.subst() throws IndexOutOfBoundsException with back-references
Status: CLOSED DUPLICATE of bug 22928
Alias: None
Product: Regexp
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS X 10.3
: P2 critical (vote)
Target Milestone: ---
Assignee: Jakarta Notifications Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 22:37 UTC by George Madrid
Modified: 2005-08-11 15:17 UTC (History)
0 users



Attachments
Patch to fix the described bug. (2.52 KB, patch)
2005-08-09 22:39 UTC, George Madrid
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Madrid 2005-08-09 22:37:43 UTC
RE re = new RE("fo(o)");
        String foo = re.subst("foo", "$1", RE.REPLACE_BACKREFERENCES);

This code throws IndexOutOfBoundsException.

I have included a patch that fixes the issue and adds a test case to watch for this.
Comment 1 George Madrid 2005-08-09 22:39:19 UTC
Created attachment 15990 [details]
Patch to fix the described bug.
Comment 2 Vadim Gritsenko 2005-08-11 04:54:54 UTC
Fixed (long time ago). Please always test against source repository first.

*** This bug has been marked as a duplicate of 22928 ***