https://issues.apache.org/bugzilla/show_bug.cgi?id=47893
Summary: Use StringBuilder instead of StringBuffer
Product: Tomcat 6
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=24305)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24305)
Patch replacing usage of StringBuffer by StringBuilder for local variables
Tomcat code base uses a lot of StringBuffer where it should use StringBuilder
for performance reasons. StringBuilder's JavaDoc is quite explicit:
"This class is designed for use as a drop-in replacement for StringBuffer in
places where the string buffer was being used by a single thread (as is
generally the case). Where possible, it is recommended that this class be used
in preference to StringBuffer as it will be faster under most implementations.
"
The provided patch replaces all usage of StringBuffer by StringBuilder for
local variables. It doesn't change any public or protected API even if it would
probably make sense (for instance in
AccessLogValve.AccessLogElement#addElement) and it doesn't change class fields.
Note that the patch just change StringBuffer to StringBuilder even in places
where the java compiler would automatically use a StringBuilder when normal
string concatenation is used.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]