diff options
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index accfaedcb..22f5b3dd1 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -78,10 +78,10 @@ public final class KeySpecParser { * or has no key specifications. */ public static String[] splitKeySpecs(final String text) { - if (TextUtils.isEmpty(text)) { + final int size = text.length(); + if (size == 0) { return null; } - final int size = text.length(); // Optimization for one-letter key specification. if (size == 1) { return text.charAt(0) == COMMA ? null : new String[] { text }; @@ -380,9 +380,6 @@ public final class KeySpecParser { public static String resolveTextReference(final String rawText, final KeyboardTextsSet textsSet) { - if (TextUtils.isEmpty(rawText)) { - return null; - } int level = 0; String text = rawText; StringBuilder sb; @@ -395,7 +392,7 @@ public final class KeySpecParser { final int prefixLen = PREFIX_TEXT.length(); final int size = text.length(); if (size < prefixLen) { - return TextUtils.isEmpty(text) ? null : text; + return text; } sb = null; @@ -424,7 +421,7 @@ public final class KeySpecParser { text = sb.toString(); } } while (sb != null); - return TextUtils.isEmpty(text) ? null : text; + return text; } private static int searchTextNameEnd(final String text, final int start) { @@ -486,7 +483,7 @@ public final class KeySpecParser { public static int toUpperCaseOfCodeForLocale(final int code, final boolean needsToUpperCase, final Locale locale) { if (!Constants.isLetterCode(code) || !needsToUpperCase) return code; - final String text = StringUtils.newSingleCodePointString(code); + final String text = new String(new int[] { code } , 0, 1); final String casedText = KeySpecParser.toUpperCaseOfStringForLocale( text, needsToUpperCase, locale); return StringUtils.codePointCount(casedText) == 1 |
