diff options
-rw-r--r-- | icu/src/main/java/com/ibm/icu4jni/util/Resources.java | 2 | ||||
-rw-r--r-- | luni/src/main/java/java/lang/String.java | 10 | ||||
-rw-r--r-- | luni/src/main/java/java/util/Locale.java | 9 | ||||
-rw-r--r-- | tools/runner/expectations.txt | 4 |
4 files changed, 20 insertions, 5 deletions
diff --git a/icu/src/main/java/com/ibm/icu4jni/util/Resources.java b/icu/src/main/java/com/ibm/icu4jni/util/Resources.java index 66bfdfb..53be6ab 100644 --- a/icu/src/main/java/com/ibm/icu4jni/util/Resources.java +++ b/icu/src/main/java/com/ibm/icu4jni/util/Resources.java @@ -84,7 +84,7 @@ public class Resources { } else if (country.length() > 0) { result.overrideWithDataFrom(getLocaleData(new Locale(language, "", ""))); } else if (language.length() > 0) { - result.overrideWithDataFrom(getLocaleData(new Locale("", "", ""))); + result.overrideWithDataFrom(getLocaleData(Locale.ROOT)); } // Override with data from this locale. result.overrideWithDataFrom(initLocaleData(locale)); diff --git a/luni/src/main/java/java/lang/String.java b/luni/src/main/java/java/lang/String.java index 1556389..eb9b17b 100644 --- a/luni/src/main/java/java/lang/String.java +++ b/luni/src/main/java/java/lang/String.java @@ -1202,6 +1202,16 @@ public final class String implements Serializable, Comparable<String>, native public String intern(); /** + * Returns true if the length of this string is 0. + * + * @since 1.6 + * @hide + */ + public boolean isEmpty() { + return count == 0; + } + + /** * Searches in this string for the last index of the specified character. * The search for the character starts at the end and moves towards the * beginning of this string. diff --git a/luni/src/main/java/java/util/Locale.java b/luni/src/main/java/java/util/Locale.java index ec36fcf..9b35a0f 100644 --- a/luni/src/main/java/java/util/Locale.java +++ b/luni/src/main/java/java/util/Locale.java @@ -157,6 +157,15 @@ public final class Locale implements Cloneable, Serializable { public static final Locale PRC = new Locale("zh", "CN"); //$NON-NLS-1$//$NON-NLS-2$ /** + * Locale constant for the root locale. The root locale has an empty language, + * country, and variant. + * + * @since 1.6 + * @hide + */ + public static final Locale ROOT = new Locale("", "", ""); + + /** * Locale constant for zh_CN. */ public static final Locale SIMPLIFIED_CHINESE = new Locale("zh", "CN"); //$NON-NLS-1$//$NON-NLS-2$ diff --git a/tools/runner/expectations.txt b/tools/runner/expectations.txt index 4c9f8e1..0ea91d0 100644 --- a/tools/runner/expectations.txt +++ b/tools/runner/expectations.txt @@ -685,10 +685,6 @@ pattern .*got java\.lang\.StringIndexOutOfBoundsException: null - FAILED.* # We don't expose Java 6 APIs -test java.lang.String.IsEmpty -result COMPILE_FAILED -pattern .*cannot find symbol.*method isEmpty\(\).* - test java.lang.String.Exceptions result COMPILE_FAILED pattern .*cannot find symbol.*new String.* |