From 50e61b86287fbb4cf76c26c22ac05fe07a659fe2 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 14 Sep 2012 15:15:42 +0900 Subject: [PATCH] Remove an unused function (A8) Change-Id: I0578068946d32192c4faf14b3e86624b7301c7d9 --- .../android/inputmethod/latin/StringUtils.java | 17 ----------------- .../inputmethod/latin/StringUtilsTests.java | 11 ----------- 2 files changed, 28 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/StringUtils.java b/java/src/com/android/inputmethod/latin/StringUtils.java index b4f3b4bc9..52fda044a 100644 --- a/java/src/com/android/inputmethod/latin/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/StringUtils.java @@ -124,23 +124,6 @@ public final class StringUtils { return true; } - /** - * Returns true if cs contains any upper case characters. - * - * @param cs the CharSequence to check - * @return {@code true} if cs contains any upper case characters, {@code false} otherwise. - */ - public static boolean hasUpperCase(final CharSequence cs) { - final int length = cs.length(); - for (int i = 0, cp = 0; i < length; i += Character.charCount(cp)) { - cp = Character.codePointAt(cs, i); - if (Character.isUpperCase(cp)) { - return true; - } - } - return false; - } - /** * Remove duplicates from an array of strings. * diff --git a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java b/tests/src/com/android/inputmethod/latin/StringUtilsTests.java index 0cef28c74..c3d9c0616 100644 --- a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/StringUtilsTests.java @@ -90,17 +90,6 @@ public class StringUtilsTests extends AndroidTestCase { StringUtils.removeFromCsvIfExists("key", "key1,key,key3,key,key5")); } - public void testHasUpperCase() { - assertTrue("single upper-case string", StringUtils.hasUpperCase("String")); - assertTrue("multi upper-case string", StringUtils.hasUpperCase("stRInG")); - assertTrue("all upper-case string", StringUtils.hasUpperCase("STRING")); - assertTrue("upper-case string with non-letters", StringUtils.hasUpperCase("He's")); - - assertFalse("empty string", StringUtils.hasUpperCase("")); - assertFalse("lower-case string", StringUtils.hasUpperCase("string")); - assertFalse("lower-case string with non-letters", StringUtils.hasUpperCase("he's")); - } - private void onePathForCaps(final CharSequence cs, final int expectedResult, final int mask) { int oneTimeResult = expectedResult & mask; assertEquals("After >" + cs + "<", oneTimeResult, StringUtils.getCapsMode(cs, mask));