[jsword-devel] StringBuffer

Chris Burrell chris at burrell.me.uk
Sun Jan 9 04:14:45 MST 2011


Hi All

In my not-so-recent version of JSword I count 133 matches of StringBuffer
and 0 matches to StringBuilder

Str]ingBuilder is much faster, because it is not synchronised / thread-safe.
So, everytime StringBuffer is declared in a local method, we can replace it
by a StringBuilder. Since the instance will never be shared. If the instance
is a instance of the object or a static instance at the top, then we can't
touch it.

Are there other reasons why we are using StringBuffer?
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20110109/f5879c31/attachment.html>


More information about the jsword-devel mailing list