Bug 160025 - CharOperation fails with AIOOBE when replaced array contains the same chars
Summary: CharOperation fails with AIOOBE when replaced array contains the same chars
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-06 10:56 EDT by Olivier Thomann CLA
Modified: 2006-10-30 05:55 EST (History)
0 users

See Also:


Attachments
Proposed fix (1.25 KB, patch)
2006-10-06 10:56 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2006-10-06 10:56:12 EDT
Running this code fails with AIOOBE:
CharOperation.replace(message.toCharArray(), new char[] {'a', 'a' }, new char[] { 'a' })

CharOperation.replace(...) doesn't properly handle the double identical characters.
Comment 1 Olivier Thomann CLA 2006-10-06 10:56:27 EDT
Created attachment 51548 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2006-10-06 12:37:36 EDT
Released for 3.3M3.
Added regression test in org.eclipse.jdt.core.tests.compiler.regression.CharOperationTest#test006
Comment 3 David Audel CLA 2006-10-30 05:55:39 EST
Verified for 3.3 M3 using build I20061030-0010