Bug 548721 - Replace some StringBuffer by StringBuilder
Summary: Replace some StringBuffer by StringBuilder
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.13 M1   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted, performance
Depends on:
Blocks: 549414
  Show dependency tree
 
Reported: 2019-06-27 09:36 EDT by Mickael Istria CLA
Modified: 2019-07-19 03:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2019-06-27 09:36:06 EDT
I see in some methods of SWT usage of StringBuffer. In the vast majority of cases, those are variables and not shared objects so StringBuffer (synchronized) adds no added value but adds extra cost.
Those instances should be replaced by StringBuilder.
Comment 1 Niraj Modi CLA 2019-06-28 05:04:18 EDT
(In reply to Mickael Istria from comment #0)
> I see in some methods of SWT usage of StringBuffer. In the vast majority of
> cases, those are variables and not shared objects so StringBuffer
> (synchronized) adds no added value but adds extra cost.
> Those instances should be replaced by StringBuilder.

I ran UNIX find and replace on my Ubuntu setup, will share a patch shortly.
Comment 2 Eclipse Genie CLA 2019-06-28 05:05:53 EDT
New Gerrit change created: https://git.eclipse.org/r/145088
Comment 4 Eric Williams CLA 2019-07-03 11:51:21 EDT
Is there still some work to be done here Niraj?
Comment 5 Niraj Modi CLA 2019-07-04 08:41:16 EDT
(In reply to Eric Williams from comment #4)
> Is there still some work to be done here Niraj?

Done with it, resolving.
Comment 6 Niraj Modi CLA 2019-07-09 07:42:10 EDT
Verified in SWT sources.