You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2006/02/27 06:32:57 UTC
[jira] Closed: (XERCESJ-1107) [PATCH] Cleanup inefficient
StringBuffer code
[ http://issues.apache.org/jira/browse/XERCESJ-1107?page=all ]
Michael Glavassevich closed XERCESJ-1107:
-----------------------------------------
Fix Version: 2.8.0
Resolution: Fixed
> [PATCH] Cleanup inefficient StringBuffer code
> ---------------------------------------------
>
> Key: XERCESJ-1107
> URL: http://issues.apache.org/jira/browse/XERCESJ-1107
> Project: Xerces2-J
> Type: Improvement
> Versions: 2.7.1
> Reporter: Dave Brosius
> Assignee: Michael Glavassevich
> Priority: Minor
> Fix For: 2.8.0
> Attachments: sb_cleanup.diff
>
> StringBuffers are used through the code, but in a way that reduces their performance below, perhaps, what normal String concatenation would be.
> Doing
> StringBuffer s = new StringBuffer();
> s.append(a + b);
> is the same as
> StringBuffer s = new StringBuffer();
> s.append(new StringBuffer(a).append(b).toString());
> So, don't do normal concatentation in an append call, since one went to the trouble to use StringBuffer's in the first place.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org