Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e689d37f authored by Jean Chalard's avatar Jean Chalard
Browse files

Remove a useless method

Change-Id: I21a4219f682f43f4a84b1ab12d00dd930b35caa1
parent 264afb10
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -315,24 +315,6 @@ public final class StringUtils {
        return true;
    }

    /**
     * Returns true if all code points in text are whitespace, false otherwise. Empty is true.
     */
    // Interestingly enough, U+00A0 NO-BREAK SPACE and U+200B ZERO-WIDTH SPACE are not considered
    // whitespace, while EN SPACE, EM SPACE and IDEOGRAPHIC SPACES are.
    public static boolean containsOnlyWhitespace(final String text) {
        final int length = text.length();
        int i = 0;
        while (i < length) {
            final int codePoint = text.codePointAt(i);
            if (!Character.isWhitespace(codePoint)) {
                return false;
            }
            i += Character.charCount(codePoint);
        }
        return true;
    }

    public static boolean isIdenticalAfterCapitalizeEachWord(final String text,
            final int[] sortedSeparators) {
        boolean needsCapsNext = true;
+0 −14
Original line number Diff line number Diff line
@@ -285,20 +285,6 @@ public class StringAndJsonUtilsTests extends AndroidTestCase {
        assertTrue(bytesStr.equals(bytesStr2));
    }

    public void testContainsOnlyWhitespace() {
        assertTrue(StringUtils.containsOnlyWhitespace("   "));
        assertTrue(StringUtils.containsOnlyWhitespace(""));
        assertTrue(StringUtils.containsOnlyWhitespace("  \n\t\t"));
        // U+2002 : EN SPACE
        // U+2003 : EM SPACE
        // U+3000 : IDEOGRAPHIC SPACE (commonly "double-width space")
        assertTrue(StringUtils.containsOnlyWhitespace("\u2002\u2003\u3000"));
        assertFalse(StringUtils.containsOnlyWhitespace("  a "));
        assertFalse(StringUtils.containsOnlyWhitespace(". "));
        assertFalse(StringUtils.containsOnlyWhitespace("."));
        assertTrue(StringUtils.containsOnlyWhitespace(""));
    }

    public void testJsonUtils() {
        final Object[] objs = new Object[] { 1, "aaa", "bbb", 3 };
        final List<Object> objArray = Arrays.asList(objs);