Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 128020

Summary: [clean up][J2SE50] convert StringBuffer usage to StringBuilder
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: akiezun, alex.blewitt, digulla, jkubitz-eclipse
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benno Baumgartner CLA 2006-02-15 08:45:33 EST
Write a clean up to convert StringBuffer usage to StringBuilder
Comment 1 Adam Kiezun CLA 2006-02-15 09:42:30 EST
for real, you'd need to do analysis to see if the buffer can escape the current thread. if yes, don't convert - you're risking race conditions (StringBuilder is unsynchronized).

(BTW, a similar refactoring would convert Vectors to ArrayLists - a similar concurrency problem arises)

An easy approximation is to check if the buffer can live longer than the current method. Most don't.
Comment 2 Benno Baumgartner CLA 2006-03-27 09:22:57 EST
Sorry, has to wait post 3.2
Comment 3 Aaron Digulla CLA 2007-12-18 04:50:58 EST
This is fixed in 3.4M4, isn't it?
Comment 4 Aaron Digulla CLA 2007-12-18 04:56:50 EST
Oops, sorry, I misunderstood the description. Bug 36350 is something else.
Comment 5 Dani Megert CLA 2010-10-22 03:10:26 EDT
*** Bug 328354 has been marked as a duplicate of this bug. ***
Comment 6 Jörg Kubitz CLA 2021-07-01 07:53:24 EDT
duplicated/implemented by Bug 572261 please close this
Comment 7 Noopur Gupta CLA 2021-07-02 09:48:04 EDT

*** This bug has been marked as a duplicate of bug 572261 ***