diff options
Diffstat (limited to 'tools/dicttool/compat/android/text/TextUtils.java')
-rw-r--r-- | tools/dicttool/compat/android/text/TextUtils.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tools/dicttool/compat/android/text/TextUtils.java b/tools/dicttool/compat/android/text/TextUtils.java index 5a94b7d4c..82483319e 100644 --- a/tools/dicttool/compat/android/text/TextUtils.java +++ b/tools/dicttool/compat/android/text/TextUtils.java @@ -25,10 +25,7 @@ public class TextUtils { * @return true if str is null or zero length */ public static boolean isEmpty(CharSequence str) { - if (str == null || str.length() == 0) - return true; - else - return false; + return (str == null || str.length() == 0); } /** @@ -45,12 +42,11 @@ public class TextUtils { if (a != null && b != null && (length = a.length()) == b.length()) { if (a instanceof String && b instanceof String) { return a.equals(b); - } else { - for (int i = 0; i < length; i++) { - if (a.charAt(i) != b.charAt(i)) return false; - } - return true; } + for (int i = 0; i < length; i++) { + if (a.charAt(i) != b.charAt(i)) return false; + } + return true; } return false; } @@ -90,7 +86,7 @@ public class TextUtils { * @param tokens an array objects to be joined. Strings will be formed from * the objects by calling object.toString(). */ - public static String join(CharSequence delimiter, Iterable tokens) { + public static String join(CharSequence delimiter, Iterable<?> tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object token: tokens) { |