Bug 32376 - Signature.getSimpleName/Qualifier should not create an own char-array
Summary: Signature.getSimpleName/Qualifier should not create an own char-array
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-20 13:26 EST by Martin Aeschlimann CLA
Modified: 2003-03-10 11:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.