diff --git a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java index d99f40765b5f242c741256d9acbbf631c2dbfe6d..1cc13f2498c9a8af50f3404b5a1ebe5699997896 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java @@ -118,7 +118,7 @@ public class InputMethodManagerCompatWrapper { } Object retval = CompatUtils.invoke(mImm, null, METHOD_getEnabledInputMethodSubtypeList, (imi != null ? imi.getInputMethodInfo() : null), allowsImplicitlySelectedSubtypes); - if (retval == null || !(retval instanceof List) || ((List<?>)retval).isEmpty()) { + if (retval == null || !(retval instanceof List<?>) || ((List<?>)retval).isEmpty()) { if (!FORCE_ENABLE_VOICE_EVEN_WITH_NO_VOICE_SUBTYPES) { // Returns an empty list return Collections.emptyList(); @@ -137,7 +137,7 @@ public class InputMethodManagerCompatWrapper { } return subtypeList; } - return CompatUtils.copyInputMethodSubtypeListToWrapper((List<?>)retval); + return CompatUtils.copyInputMethodSubtypeListToWrapper(retval); } private InputMethodInfoCompatWrapper getLatinImeInputMethodInfo() { @@ -159,7 +159,7 @@ public class InputMethodManagerCompatWrapper { public Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>> getShortcutInputMethodsAndSubtypes() { Object retval = CompatUtils.invoke(mImm, null, METHOD_getShortcutInputMethodsAndSubtypes); - if (retval == null || !(retval instanceof Map) || ((Map<?, ?>)retval).isEmpty()) { + if (retval == null || !(retval instanceof Map<?, ?>) || ((Map<?, ?>)retval).isEmpty()) { if (!FORCE_ENABLE_VOICE_EVEN_WITH_NO_VOICE_SUBTYPES) { // Returns an empty map return Collections.emptyMap(); diff --git a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java index 0d0591bd0d0ca756fa058a7ffd5134db357b23f3..753dceead09d9bea2e35daab639e0803bbf75375 100644 --- a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java +++ b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java @@ -754,15 +754,15 @@ public class VoiceProxy implements VoiceInput.UiListener { } public static class VoiceLoggerWrapper { - private static final VoiceLoggerWrapper sInstance = new VoiceLoggerWrapper(); + private static final VoiceLoggerWrapper sLoggerWrapperInstance = new VoiceLoggerWrapper(); private VoiceInputLogger mLogger; public static VoiceLoggerWrapper getInstance(Context context) { - if (sInstance.mLogger == null) { + if (sLoggerWrapperInstance.mLogger == null) { // Not thread safe, but it's ok. - sInstance.mLogger = VoiceInputLogger.getLogger(context); + sLoggerWrapperInstance.mLogger = VoiceInputLogger.getLogger(context); } - return sInstance; + return sLoggerWrapperInstance; } // private for the singleton @@ -795,10 +795,10 @@ public class VoiceProxy implements VoiceInput.UiListener { } public static class VoiceInputWrapper { - private static final VoiceInputWrapper sInstance = new VoiceInputWrapper(); + private static final VoiceInputWrapper sInputWrapperInstance = new VoiceInputWrapper(); private VoiceInput mVoiceInput; public static VoiceInputWrapper getInstance() { - return sInstance; + return sInputWrapperInstance; } public void setVoiceInput(VoiceInput voiceInput, SubtypeSwitcher switcher) { if (mVoiceInput == null && voiceInput != null) { diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java index 1a606eaafd272806f6494ae91231cf1d20e5ce86..5ef236e3117b18aabde17b8839417af9bd51d057 100644 --- a/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java +++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java @@ -16,7 +16,6 @@ package com.android.inputmethod.deprecated.languageswitcher; -import com.android.inputmethod.compat.InputMethodSubtypeCompatWrapper; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.Settings; @@ -38,6 +37,7 @@ import java.util.Locale; public class LanguageSwitcher { private static final String TAG = LanguageSwitcher.class.getSimpleName(); + @SuppressWarnings("unused") private static final String KEYBOARD_MODE = "keyboard"; private static final String[] EMPTY_STIRNG_ARRAY = new String[0]; @@ -154,7 +154,6 @@ public class LanguageSwitcher { /** * Returns the currently selected input locale, or the display locale if no specific * locale was selected for input. - * @return */ public Locale getInputLocale() { if (getLocaleCount() == 0) return mDefaultInputLocale; @@ -175,7 +174,6 @@ public class LanguageSwitcher { /** * Returns the next input locale in the list. Wraps around to the beginning of the * list if we're at the end of the list. - * @return */ public Locale getNextInputLocale() { if (getLocaleCount() == 0) return mDefaultInputLocale; @@ -201,7 +199,6 @@ public class LanguageSwitcher { /** * Returns the previous input locale in the list. Wraps around to the end of the * list if we're at the beginning of the list. - * @return */ public Locale getPrevInputLocale() { if (getLocaleCount() == 0) return mDefaultInputLocale; diff --git a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java index dcd124f703804d83b64f6d5d112b67aa1b6a703e..87b943426476acb3294f9c3f760023d405be7b72 100644 --- a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java +++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java @@ -17,7 +17,6 @@ package com.android.inputmethod.deprecated.voice; import com.android.common.speech.LoggingEvents; -import com.android.common.userhappiness.UserHappinessSignals; import com.android.inputmethod.deprecated.compat.VoiceInputLoggerCompatUtils; import android.content.Context; diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 7e63aacdf0fc63d5328be0f5aef60d049eae8fe0..5416cd5716ac87b6451387e02ab10af3521cb05a 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -145,7 +145,7 @@ public class BinaryDictionary extends Dictionary { * @param context application context for reading resources * @param dicTypeId the type of the dictionary being created, out of the list in Suggest.DIC_* * @param locale the locale for which to create the dictionary - * @param fallBackResId the id of the resource to use as a fallback if no pack is found + * @param fallbackResId the id of the resource to use as a fallback if no pack is found * @return an initialized instance of BinaryDictionary */ public static BinaryDictionary initDictionaryFromManager(Context context, int dicTypeId, diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 72512c7e167ec4010fc23530cae3baa678912af0..c4e098a0cbfddf879d5a020c89a2395db575a1ec 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -65,9 +65,6 @@ class BinaryDictionaryGetter { * If that fails: * - Returns null. * @return The address of a valid file, or null. - * @throws FileNotFoundException if a dictionary provider returned a file name, but the - * file cannot be found. - * @throws IOException if there was an I/O problem reading or copying a file. */ public static AssetFileAddress getDictionaryFile(Locale locale, Context context, int fallbackResId) { diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java index ac43d6477b4f89d7272b6bac61996fd733a76e07..c7737b9a2769d40c500c96be08d20912fa3c14a9 100644 --- a/java/src/com/android/inputmethod/latin/Dictionary.java +++ b/java/src/com/android/inputmethod/latin/Dictionary.java @@ -61,7 +61,7 @@ public abstract class Dictionary { * words are added through the callback object. * @param composer the key sequence to match * @param callback the callback object to send matched words to as possible candidates - * @see WordCallback#addWord(char[], int, int) + * @see WordCallback#addWord(char[], int, int, int, int, DataType) */ abstract public void getWords(final WordComposer composer, final WordCallback callback); diff --git a/java/src/com/android/inputmethod/latin/EditingUtils.java b/java/src/com/android/inputmethod/latin/EditingUtils.java index ea281f5b85947807d5bc656fd08b8fd8cf4e4c54..39e7e402f62e75123be449bf50ba8c832c0ab55b 100644 --- a/java/src/com/android/inputmethod/latin/EditingUtils.java +++ b/java/src/com/android/inputmethod/latin/EditingUtils.java @@ -73,7 +73,7 @@ public class EditingUtils { /** * @param connection connection to the current text field. - * @param sep characters which may separate words + * @param separators characters which may separate words * @return the word that surrounds the cursor, including up to one trailing * separator. For example, if the field contains "he|llo world", where | * represents the cursor, then "hello " will be returned. diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 15743ee2d870e54eb2af5db86b41da0eb14439ba..1f6146a6dd23f4f7d721be37624165eee2c99477 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -56,7 +56,7 @@ public class Suggest implements Dictionary.WordCallback { /** * Maximum possible bigram frequency. Will depend on how many bits are being used in data - * structure. Maximum bigram freqeuncy will get the BIGRAM_MULTIPLIER_MAX as the multiplier. + * structure. Maximum bigram frequency will get the BIGRAM_MULTIPLIER_MAX as the multiplier. */ public static final int MAXIMUM_BIGRAM_FREQUENCY = 127; diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index f8b23cb65601ee331338d9ed9f4c727ecd40ef17..b5afb50793957aa3d0fcd9f98a363c7ae98668ac 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -648,6 +648,6 @@ public class Utils { /** Convert pixel to DIP */ public static int dipToPixel(float scale, int dip) { - return (int) ((float) dip * scale + 0.5); + return (int) (dip * scale + 0.5); } }