Community
Participate
Working Groups
Build ID: I20080502-0100 Steps To Reproduce: The Scribe class uses a lot of StringBuffer instances. They can be replaced with StringBuilder without any additional efforts. Since all instances are local variables and are not involved in mutlithreaded interactions, there is no need to use synchronized StringBuffer. More information:
StringBuilder is a 1.5 class and JDT/Core cannot use any classes from 1.5. The EE specified for JDT/Core is 1.4. Closing as INVALID.
Setting target milestone to 3.4RC1 as per JDT/Core process
Question: how would a JDT backport of StringBuilder fare on a cost/benefit standpoint?
I agree that even if StringBuilder is not usable because it's a part of JRE 1.5, we can improve the Scribe to avoid StringBuffer current intensive usage...
My point was more along the following: we have utilities in place around char arrays, etc., that focus on speed quite a bit, and were (and still are) somewhat involving in terms of implementation when they were coded. I believe it would not be stretching such a design too much to envision adding a port of StringBuilder to that arsenal, *provided we get some clear benefit from doing so*.
In fact that was exactly what I understood of your remark but I took advantage of this bug to remind that some performance improvements could be done in the Scribe (in fact the exact summary of this bug). IMO, this could be done either by using an internal class as you suggested or a more aggressive way which would avoid to use any temporary buffer by creating edits directly...
StringBuffer allocations have been strongly reduced while improving formatter performances in 3.6, hence closing this bug as duplicate of bug 310811. *** This bug has been marked as a duplicate of bug 310811 ***
The number of StringBuffer creation(s) has been reduced a lot in bug 310811. However, as I understand all the string buffer methods are synchronized and hence they could still be having some performance impact. As we will be moving to Java 1.5, I think we should keep this bug open. Olivier, comments?
Once we move to 1.5, we should use StringBuilder instead of StringBuffer. Satyam, please update the title accordingly.
Reopening this as we want to move to Java 1.5. When we move to Java 1.5, we could use StringBuilder instead of StringBuffer.
(In reply to comment #10) > Reopening this as we want to move to Java 1.5. When we move to Java 1.5, we > could use StringBuilder instead of StringBuffer. Satyam, do you expect me to have a look on this when possible?
Thanks Frederic. I can take care of this when we move to 1.5.
This bug is no longer relevant after bug 303519 - the new formatter doesn't use any StringBuffers. *** This bug has been marked as a duplicate of bug 303519 ***