summaryrefslogtreecommitdiffstats
path: root/xml/src/main/java
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
commitf787a8787d0b7bcdc178ffc2e3343f1c1b02ed30 (patch)
tree2802ec85df008606d8e0765d8f3c14a090b12f93 /xml/src/main/java
parent2cb7451712f56b28daaf59c71831951b303c3dcf (diff)
downloadlibcore-f787a8787d0b7bcdc178ffc2e3343f1c1b02ed30.zip
libcore-f787a8787d0b7bcdc178ffc2e3343f1c1b02ed30.tar.gz
libcore-f787a8787d0b7bcdc178ffc2e3343f1c1b02ed30.tar.bz2
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 'xml/src/main/java')
-rw-r--r--xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java b/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
index 1a8122c..eacf0a0 100644
--- a/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
+++ b/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;
}