Bug 32376

Summary: Signature.getSimpleName/Qualifier should not create an own char-array
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Martin Aeschlimann CLA 2003-02-20 13:26:16 EST
20030220

Signature.getSimpleName/Signature.getQualifier is very popular in JDT-UI and 
heavyly used (also, and quite often in inner loops).
I looked at the implementation and say that it creates a new char array.
It would be better to do a String.substring(..) which reuses the String's 
internal char buffer.
Comment 1 Martin Aeschlimann CLA 2003-02-20 13:29:04 EST
I'm talking of course about the Signature.getSimpleName(String), 
Signature.getQualifier(String) methods
Comment 2 Philipe Mulet CLA 2003-02-20 15:01:31 EST
Pls investigate. We need to be careful if someone could alter the original 
array.
Comment 3 Olivier Thomann CLA 2003-02-20 15:11:09 EST
Using the String method is fairly safe, since Strings are immutable. I will run 
all tests with my changes.
Comment 4 Olivier Thomann CLA 2003-02-20 15:46:53 EST
Changes using only string operations work fine. All tests passed.
Comment 5 Olivier Thomann CLA 2003-02-20 15:47:29 EST
I will wait RC1 to be out before I release it.
Comment 6 Olivier Thomann CLA 2003-02-21 08:51:16 EST
Change milestone. Fix is ready to be released.
Comment 7 Olivier Thomann CLA 2003-02-25 14:25:54 EST
Fixed and released in 2.1 stream.
Comment 8 Olivier Thomann CLA 2003-03-10 11:50:18 EST
Verified.