Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8127
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: StringBuilder |
| Date | Sun, 18 Sep 2011 09:50:03 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 36 |
| Message-ID | <j54svs$u9u$1@dont-email.me> (permalink) |
| References | <96f358c8-a024-40db-b60b-300186c2f813@o10g2000vby.googlegroups.com> <j41fik$3qb$1@news.albasani.net> <j52jgd$iij$1@dont-email.me> <vp7a77lp3e5oe4h79pnmv95vb4lu13spmc@4ax.com> <GeednbWNqODBGOjTnZ2dnUVZ_rqdnZ2d@posted.palinacquisition> <j54nc9$tgk$1@dont-email.me> <j54rss$j3q$1@news.albasani.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Sun, 18 Sep 2011 13:50:52 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="f8igmItKsWs6nM5YanFxAA"; logging-data="31038"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xB0yWlOSXQbFzJF3J8Pjo" |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 |
| In-Reply-To | <j54rss$j3q$1@news.albasani.net> |
| Cancel-Lock | sha1:iMFA/yMEVwWIz/QRGYKi+3BPfA4= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8127 |
Show key headers only | View raw
On 9/18/2011 9:32 AM, Jan Burse wrote:
> Eric Sosman schrieb:
>> I don't have old Java source, but I do have an old O'Reilly
>> book ("Java In a Nutshell, 2nd Edition, Covers Java 1.1, by David
>> Flanagan") that states
>>
>> The StringBuffer.toString() method does not copy the internal
>> array of characters; instead it shares that array with the
>> new String object, and makes a new copy for itself only when
>> further modifications are made to the StringBuffer object.
>>
>> Assuming the author was correct, it follows that the implementation
>> changed at some later point. Presumably, that change was driven by
>> evidence that the "optimization" wasn't worth while.
>
> I guess first of all probably a reengineering was done, and
> StringBuffer was split into AbstractStringBuilder and StringBuffer.
> And then StringBuilder was created. The class diagramm is basically:
>
> AbstractStringBuilder
> / \
> StringBuffer StringBuilder
I do not know whether buffer-sharing was dropped before, after,
or with the introduction of StringBuilder.
> Most of the StringBuffer methods are synchronized and then delegate
> to the abstract super class. In StringBuilder the methods are
> non-synchronized and then also delegate to the abstract super class.
Some methods delegate, some do not. StringBuilder.toString()
in particular does not delegate to the superclass.
--
Eric Sosman
esosman@ieee-dot-org.invalid
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: StringBuilder Stanimir Stamenkov <s7an10@netscape.net> - 2011-09-17 19:56 +0300
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-17 20:35 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-17 15:34 -0700
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 01:33 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 01:56 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-17 20:58 -0700
Re: StringBuilder Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-17 22:44 -0700
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 09:54 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 09:59 +0200
Re: StringBuilder Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-18 07:28 -0700
Re: StringBuilder Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-18 08:15 -0400
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 15:32 +0200
Re: StringBuilder Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-18 09:50 -0400
Re: StringBuilder Stanimir Stamenkov <s7an10@netscape.net> - 2011-09-18 17:08 +0300
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:13 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:29 +0200
Re: StringBuilder Jan Burse <janburse@fastmail.fm> - 2011-09-18 22:39 +0200
Re: StringBuilder Roedy Green <see_website@mindprod.com.invalid> - 2011-09-19 09:45 -0700
csiph-web