aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/com/android')
-rw-r--r--common/src/com/android/inputmethod/latin/common/LocaleUtils.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/common/src/com/android/inputmethod/latin/common/LocaleUtils.java b/common/src/com/android/inputmethod/latin/common/LocaleUtils.java
index 7f2333be5..d5878c024 100644
--- a/common/src/com/android/inputmethod/latin/common/LocaleUtils.java
+++ b/common/src/com/android/inputmethod/latin/common/LocaleUtils.java
@@ -104,7 +104,8 @@ public final class LocaleUtils {
* @param testedLocale the locale to test.
* @return a constant that measures how well the tested locale matches the reference locale.
*/
- public static int getMatchLevel(final String referenceLocale, final String testedLocale) {
+ public static int getMatchLevel(@Nullable final String referenceLocale,
+ @Nullable final String testedLocale) {
if (StringUtils.isEmpty(referenceLocale)) {
return StringUtils.isEmpty(testedLocale) ? LOCALE_FULL_MATCH : LOCALE_ANY_MATCH;
}
@@ -167,11 +168,8 @@ public final class LocaleUtils {
* @param localeString a string specification of a locale, in a format of "ll_cc_variant" where
* "ll" is a language code, "cc" is a country code.
*/
- @Nullable
- public static Locale constructLocaleFromString(@Nullable final String localeString) {
- if (localeString == null) {
- return null;
- }
+ @Nonnull
+ public static Locale constructLocaleFromString(@Nonnull final String localeString) {
synchronized (sLocaleCache) {
if (sLocaleCache.containsKey(localeString)) {
return sLocaleCache.get(localeString);