From d3a4c5132422b189c8dbb94dbbe84a9b9761b0a8 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 22 Oct 2014 14:04:07 +0900 Subject: [PATCH] Fix Javadoc and null analysis related warnings This CL also adds @SuppressWarning("unused" to java-overridable package. Bug: 18003991 Change-Id: If70527e30654384705d7a814f5efd181d9f539e1 --- .../compat/AppWorkaroundsHelper.java | 1 + .../dictionarypack/MetadataUriGetter.java | 1 + .../latin/accounts/LoginAccountUtils.java | 1 + .../latin/define/ProductionFlags.java | 3 +- .../ContextualDictionaryUpdater.java | 1 + .../PersonalizationDictionaryUpdater.java | 1 + .../AdditionalFeaturesSettingUtils.java | 1 + .../touchinputconsumer/GestureConsumer.java | 2 + .../latin/utils/FeedbackUtils.java | 1 + .../latin/utils/MetadataFileUriGetter.java | 1 + .../inputmethod/latin/utils/StatsUtils.java | 1 + .../latin/utils/StatsUtilsManager.java | 1 + java/res/values/attrs.xml | 62 ++++++++++++------- java/res/values/donottranslate.xml | 2 +- java/res/values/keyboard-themes.xml | 3 +- java/res/values/themes-common.xml | 6 +- java/res/values/themes-ics.xml | 6 +- java/res/values/themes-klp.xml | 6 +- java/res/values/themes-lxx-dark.xml | 6 +- java/res/values/themes-lxx-light.xml | 6 +- .../compat/CursorAnchorInfoCompatWrapper.java | 2 + .../compat/InputMethodSubtypeCompatUtils.java | 1 + .../DictionarySettingsActivity.java | 6 +- .../DownloadOverMeteredDialog.java | 9 +++ .../inputmethod/event/CombinerChain.java | 3 +- .../inputmethod/event/DeadKeyCombiner.java | 7 +-- .../com/android/inputmethod/event/Event.java | 1 + .../inputmethod/keyboard/TextDecorator.java | 6 +- .../internal/AbstractDrawingPreview.java | 5 +- .../keyboard/internal/KeyboardBuilder.java | 4 +- .../keyboard/internal/MoreKeySpec.java | 3 + .../internal/TouchPositionCorrection.java | 2 +- .../inputmethod/latin/BinaryDictionary.java | 32 +++++++--- .../latin/BinaryDictionaryGetter.java | 4 +- .../android/inputmethod/latin/Constants.java | 8 +-- .../latin/ContactsBinaryDictionary.java | 5 +- .../android/inputmethod/latin/Dictionary.java | 8 +++ .../latin/DictionaryFacilitator.java | 9 ++- .../latin/ExpandableBinaryDictionary.java | 4 ++ .../android/inputmethod/latin/InputView.java | 5 +- .../android/inputmethod/latin/LatinIME.java | 3 +- .../inputmethod/latin/NgramContext.java | 7 +++ .../latin/PunctuationSuggestions.java | 6 +- .../latin/RichInputConnection.java | 3 + .../latin/RichInputMethodManager.java | 5 +- .../inputmethod/latin/SubtypeSwitcher.java | 4 +- .../latin/UserBinaryDictionary.java | 5 +- .../inputmethod/latin/WordComposer.java | 2 +- .../latin/inputlogic/InputLogic.java | 10 +-- .../network/HttpUrlConnectionBuilder.java | 4 +- .../personalization/ContextualDictionary.java | 6 +- .../PersonalizationDictionary.java | 6 +- .../UserHistoryDictionary.java | 12 ++-- .../inputmethod/latin/settings/Settings.java | 4 +- .../latin/settings/SettingsValues.java | 12 ++-- .../AndroidSpellCheckerSession.java | 5 +- .../SpellCheckerSettingsActivity.java | 6 +- .../userdictionary/UserDictionaryList.java | 12 ++-- .../UserDictionarySettings.java | 15 +++-- .../latin/utils/DistracterFilter.java | 11 ++-- .../latin/utils/NgramContextUtils.java | 9 ++- .../latin/utils/ResourceUtils.java | 2 +- .../inputmethod/latin/utils/StringUtils.java | 6 +- .../makedict/BinaryDictDecoderUtils.java | 2 +- .../makedict/BinaryDictEncoderUtils.java | 2 +- .../latin/makedict/BinaryDictIOUtils.java | 4 +- .../latin/makedict/Ver4DictDecoder.java | 7 +-- .../latin/utils/CollectionUtilsTests.java | 4 +- .../compat/android/test/MoreAsserts.java | 35 ----------- .../inputmethod/keyboard/Keyboard.java | 1 + .../inputmethod/latin/dicttool/Info.java | 5 +- .../PersonalizationHelper.java | 1 + 72 files changed, 273 insertions(+), 179 deletions(-) delete mode 100644 tools/dicttool/compat/android/test/MoreAsserts.java diff --git a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java index 21535e421..f5e56eb4b 100644 --- a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java +++ b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java @@ -18,6 +18,7 @@ package com.android.inputmethod.compat; import android.content.pm.PackageInfo; +@SuppressWarnings("unused") public class AppWorkaroundsHelper { private AppWorkaroundsHelper() { // This helper class is not publicly instantiable. diff --git a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java index ed817658e..d8951df86 100644 --- a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java +++ b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java @@ -21,6 +21,7 @@ import android.content.Context; /** * Helper to get the metadata URI from its base URI and the additional ID, if any. */ +@SuppressWarnings("unused") public class MetadataUriGetter { private MetadataUriGetter() { // This helper class is not instantiable. diff --git a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java index e07a9f358..dcc64a223 100644 --- a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java @@ -40,6 +40,7 @@ public class LoginAccountUtils { * @return an array of accounts. Empty (never null) if no accounts are available for login. */ @Nonnull + @SuppressWarnings("unused") public static String[] getAccountsForLogin(final Context context) { return new String[0]; } diff --git a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java index 99b958952..f80625644 100644 --- a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java +++ b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java @@ -24,7 +24,8 @@ public final class ProductionFlags { public static final boolean IS_HARDWARE_KEYBOARD_SUPPORTED = false; /** - * Include all suggestions from all dictionaries in {@link SuggestedWords#mRawSuggestions}. + * Include all suggestions from all dictionaries in + * {@link com.android.inputmethod.latin.SuggestedWords#mRawSuggestions}. */ public static final boolean INCLUDE_RAW_SUGGESTIONS = false; diff --git a/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java index 7dc120e06..fe1d846d8 100644 --- a/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java +++ b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java @@ -20,6 +20,7 @@ import android.content.Context; import com.android.inputmethod.latin.DictionaryFacilitator; +@SuppressWarnings("unused") public class ContextualDictionaryUpdater { public ContextualDictionaryUpdater(final Context context, final DictionaryFacilitator dictionaryFacilitator, diff --git a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java index 8b66cff53..64bace35a 100644 --- a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java +++ b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java @@ -20,6 +20,7 @@ import android.content.Context; import com.android.inputmethod.latin.DictionaryFacilitator; +@SuppressWarnings("unused") public class PersonalizationDictionaryUpdater { final Context mContext; final DictionaryFacilitator mDictionaryFacilitator; diff --git a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java index 1dfaf259e..bd54238f8 100644 --- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java @@ -29,6 +29,7 @@ import javax.annotation.Nonnull; /** * Utility class for managing additional features settings. */ +@SuppressWarnings("unused") public class AdditionalFeaturesSettingUtils { public static final int ADDITIONAL_FEATURES_SETTINGS_SIZE = 0; diff --git a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java index 672d6d1a1..1d60e0cf5 100644 --- a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java +++ b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java @@ -17,6 +17,7 @@ package com.android.inputmethod.latin.touchinputconsumer; import android.view.inputmethod.EditorInfo; + import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.InputPointers; import com.android.inputmethod.latin.SuggestedWords; @@ -31,6 +32,7 @@ import java.util.Locale; * The methods of this class should only be called from a single thread, e.g., * the UI Thread. */ +@SuppressWarnings("unused") public class GestureConsumer { public static final GestureConsumer NULL_GESTURE_CONSUMER = new GestureConsumer(); diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java index 0aed41ee4..67de8ba32 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java @@ -19,6 +19,7 @@ package com.android.inputmethod.latin.utils; import android.content.Context; import android.content.Intent; +@SuppressWarnings("unused") public class FeedbackUtils { public static boolean isHelpAndFeedbackFormSupported() { return false; diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java index 9ad319da6..97fb17de3 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java @@ -23,6 +23,7 @@ import android.content.Context; /** * Helper class to get the metadata URI and the additional ID. */ +@SuppressWarnings("unused") public class MetadataFileUriGetter { private MetadataFileUriGetter() { // This helper class is not instantiable. diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java index fcaeca827..044970267 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java @@ -22,6 +22,7 @@ import com.android.inputmethod.latin.settings.SettingsValues; import javax.annotation.Nullable; +@SuppressWarnings("unused") public final class StatsUtils { private StatsUtils() { diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java index 138f70f4c..c99dbf6a1 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java @@ -21,6 +21,7 @@ import android.content.Context; import com.android.inputmethod.latin.settings.SettingsValues; +@SuppressWarnings("unused") public class StatsUtilsManager { private static final StatsUtilsManager sInstance = new StatsUtilsManager(); diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index be35d131d..bf36337a1 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -43,15 +43,18 @@ - + + {@link android.graphics.drawable.StateListDrawable}, with the following possible + states: normal, pressed. --> + {@link android.graphics.drawable.StateListDrawable}, with the following possible + states: normal, pressed. --> @@ -200,7 +203,8 @@ - + @@ -218,7 +222,8 @@ - + @@ -240,8 +245,8 @@ - + @@ -287,7 +292,8 @@ - + @@ -298,7 +304,8 @@ - + @@ -312,7 +319,8 @@ - + @@ -357,7 +365,8 @@ - + @@ -368,7 +377,7 @@ - + @@ -391,11 +400,11 @@ + {@link com.android.inputmethod.latin.utils.TypefaceUtils#KEY_LABEL_REFERENCE_CHAR}. --> + {@link com.android.inputmethod.latin.utils.TypefaceUtils#KEY_LABEL_REFERENCE_CHAR}. --> @@ -425,7 +434,8 @@ - + @@ -445,14 +455,16 @@ - + - + @@ -469,7 +481,8 @@ - + @@ -478,7 +491,8 @@ - + @@ -495,7 +509,8 @@ - + @@ -525,7 +540,8 @@ - + diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml index 959fe833b..817bb5187 100644 --- a/java/res/values/donottranslate.xml +++ b/java/res/values/donottranslate.xml @@ -19,7 +19,7 @@ --> + @see com.android.inputmethod.latin.settings.SettingsValues#needsToShowVoiceInputKey(android.content.SharedPreferences,android.content.res.Resources) --> 0 + 3 4 diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml index f7cb10f93..2f768de71 100644 --- a/java/res/values/themes-common.xml +++ b/java/res/values/themes-common.xml @@ -105,8 +105,10 @@ - + - + - + - +