summaryrefslogtreecommitdiffstats
path: root/libcore/xml
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-12-17 21:09:08 -0800
committerElliott Hughes <enh@google.com>2009-12-18 10:35:28 -0800
commit369a8d273180de03122c1b90a0949ce7b52427ba (patch)
tree4a9fd6d0b3845310124d80cd3760fe21728b5c8d /libcore/xml
parentbe9dbaf4f84ae0280c7548f1c8a93224399e7c15 (diff)
downloadandroid_dalvik-369a8d273180de03122c1b90a0949ce7b52427ba.tar.gz
android_dalvik-369a8d273180de03122c1b90a0949ce7b52427ba.tar.bz2
android_dalvik-369a8d273180de03122c1b90a0949ce7b52427ba.zip
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.)
Diffstat (limited to 'libcore/xml')
-rw-r--r--libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java b/libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
index 1a8122c6b..eacf0a070 100644
--- a/libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
+++ b/libcore/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
@@ -475,7 +475,7 @@ class DocumentBuilderImpl extends DocumentBuilder {
if (ch < 0 || ch > Character.MAX_VALUE) {
return null;
}
- return Character.toString((char) ch);
+ return String.valueOf((char) ch);
} catch (NumberFormatException ex) {
return null;
}