[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: StringBuilder
From: |
Jeroen Frijters |
Subject: |
RE: StringBuilder |
Date: |
Mon, 20 Dec 2004 16:52:52 +0100 |
David Holmes wrote:
> If this is for Java 5.0 support then rewrite StringBuilder to
> use Atomics.
I considered this, but allocating yet another object didn't seem like a
good idea.
> I'm obviously missing some context for this however. Is the
> char[] really shared that often in practice with StringBuffer?
It is about sharing with String. Typical usage of a StringBuilder will
be to create it, do a few operations to build the string and then call
toString on it. It would be nice to reuse the char[] in the String
(because typically the StringBuilder will not be used anymore), but this
turns out to be a pretty hard problem.
Regards,
Jeroen