Bug 160025

Summary: CharOperation fails with AIOOBE when replaced array contains the same chars
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

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