From f787a8787d0b7bcdc178ffc2e3343f1c1b02ed30 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Dec 2009 21:09:08 -0800 Subject: 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.) --- .../main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xml/src/main/java/org') 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; } -- cgit v1.1