Summary: | AST nodes and string buffers | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jim des Rivieres <jeem> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.0 | ||
Target Milestone: | 3.0 M6 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Jim des Rivieres
2003-11-13 14:12:45 EST
Incorrectly entered. Moving to JDT Core. StringBuffer.toString() calls new String(sb). So I really don't see any memory improvement. We could get a small improvement in time. You're quite quite. The Sun implementation of both "sb.toString()" and "new String(sb)" are equivalent and return a String object that occupies space proportional to sb.capacity(). On the other hand, "sb.substring(0)" returns a String object with space proportional to sb.length(). So I guess you'd like the latter to be used. I will get rid of new StringBuffer(6000); and replace it with new StringBuffer(). Then we use the default behavior of the StringBuffer. Fixed and released in HEAD. Verified for 3.0M6 |