<Swing Dev> Replace concat String to append in StringBuilder parameters
Andrej Golovnin
andrej.golovnin at gmail.com
Thu Aug 21 13:37:54 UTC 2014
Hi Martin,
you are right. And in the line 297:
297 sb.append(getClass().getName()).append('
').append(Integer.toString(hashCode()));
Integer.toString() can be removed too.
Best regards,
Andrej Golovnin
On Thu, Aug 21, 2014 at 3:26 PM, Martin Desruisseaux <
martin.desruisseaux at geomatys.fr> wrote:
> I had a random look at the Webrev for TreeModelEvent.java and saw the
> following new code:
>
> sb.append(Integer.toString(childIndices[counter]))
>
> Wouldn't the following be slightly more efficient?
>
> sb.append(childIndices[counter])
>
> since Integer.toString(int) creates a temporary char[] array later
> copied in the StringBuilder, while StringBuilder.append(int) writes
> directly in the buffer internal array.
>
>
> Martin
>
>
>
> Le 21/08/14 14:53, Wang Weijun a écrit :
> > I filed a bug at
> >
> > https://bugs.openjdk.java.net/browse/JDK-8038277
> >
> > Webrev in 3 parts at
> >
> > http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00
> > http://cr.openjdk.java.net/~weijun/8038277/core/webrev.00/
> > http://cr.openjdk.java.net/~weijun/8038277/extra/webrev.00/
> >
> > --Max
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20140821/527a8a83/attachment.html>
More information about the swing-dev
mailing list