From bc501647fd5b7af741c65d62a18797e5cf656593 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 15 Apr 2013 22:01:37 +0900 Subject: [PATCH] Remove a useless function Bug: 8583091 Change-Id: I9195d68e44e9a282e25ccd2978d7b4088f600170 --- .../android/inputmethod/latin/StringUtils.java | 11 ----------- .../inputmethod/latin/StringUtilsTests.java | 18 ------------------ 2 files changed, 29 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/StringUtils.java b/java/src/com/android/inputmethod/latin/StringUtils.java index 3ca209d34..7f1e7c619 100644 --- a/java/src/com/android/inputmethod/latin/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/StringUtils.java @@ -282,15 +282,4 @@ public final class StringUtils { } return builder.toString(); } - - public static boolean containsAny(final String string, final String separators) { - final int len = separators.length(); - for (int i = 0; i < len; i = separators.offsetByCodePoints(i, 1)) { - final int separator = separators.codePointAt(i); - if (-1 != string.indexOf(separator)) { - return true; - } - } - return false; - } } diff --git a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java b/tests/src/com/android/inputmethod/latin/StringUtilsTests.java index 136faff71..98a50b730 100644 --- a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/StringUtilsTests.java @@ -215,22 +215,4 @@ public class StringUtilsTests extends AndroidTestCase { checkCapitalize("Lorem!Ipsum (dolor) Sit * Amet", "Lorem!Ipsum (Dolor) Sit * Amet", " \n,.;!?*()&", Locale.ENGLISH); } - - public void testContainsAny() { - assertFalse(StringUtils.containsAny("", " ")); - assertFalse(StringUtils.containsAny("test and retest", "")); - assertTrue(StringUtils.containsAny("test and retest", "x3iq o")); - assertTrue(StringUtils.containsAny("test and retest", "x3iqo ")); - assertTrue(StringUtils.containsAny("test and retest", " x3iqo")); - assertFalse(StringUtils.containsAny("test and retest", "x3iqo")); - assertTrue(StringUtils.containsAny("test and retest", "tse ")); - assertTrue(StringUtils.containsAny("test and retest.", ".?()")); - assertFalse(StringUtils.containsAny("test and retest", ".?()")); - // Surrogate pair - assertTrue(StringUtils.containsAny("test and \uD861\uDED7 retest.", "\uD861\uDED7")); - // Ill-formed string - assertFalse(StringUtils.containsAny("test and \uD861 retest.", "\uD861\uDED7")); - // Ill-formed string - assertFalse(StringUtils.containsAny("test and \uDED7 retest.", "\uD861\uDED7")); - } }