OSDN Git Service

Depessimize string conversions.
authorElliott Hughes <enh@google.com>
Fri, 18 Dec 2009 05:09:08 +0000 (21:09 -0800)
committerElliott Hughes <enh@google.com>
Fri, 18 Dec 2009 18:35:28 +0000 (10:35 -0800)
commit369a8d273180de03122c1b90a0949ce7b52427ba
tree4a9fd6d0b3845310124d80cd3760fe21728b5c8d
parentbe9dbaf4f84ae0280c7548f1c8a93224399e7c15
Depessimize string conversions.

Why does this idiom persist? It's ugly, and it's the least efficient way to do
it. (I found the ones in DecimalFormatSymbols while invesigating why
"new SimpleDateFormat()" burns through so many StringBuilders. grep(1) found
the rest.)

The DocumentBuilderImpl removes an unnecessary level of indirection, since we
implement Character.toString in terms of String.valueOf. (I wouldn't have
bothered except this was the only use of Character.toString in the core
libraries, and I added it myself a few weeks ago.)
libcore/icu/src/main/java/com/ibm/icu4jni/text/DecimalFormatSymbols.java
libcore/icu/src/main/java/com/ibm/icu4jni/util/Resources.java
libcore/luni/src/main/java/java/util/Date.java
libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java