From dbd140504d0f1c6b02998d0899efc853e78a3966 Mon Sep 17 00:00:00 2001
From: Jean Chalard <jchalard@google.com>
Date: Fri, 9 Mar 2012 18:18:24 +0900
Subject: [PATCH] Reduction, step 5

Change-Id: Iac52e62c2bdffad14f916f69eade2b785bb41767
---
 .../src/com/android/inputmethod/latin/Suggest.java | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 058c8ad74..034fe09ba 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -263,8 +263,6 @@ public class Suggest implements Dictionary.WordCallback {
     private static final WordComposer sEmptyWordComposer = new WordComposer();
     public SuggestedWords.Builder getBigramPredictionWordBuilder(CharSequence prevWordForBigram,
             final ProximityInfo proximityInfo, final int correctionMode) {
-        final WordComposer wordComposer = sEmptyWordComposer;
-
         LatinImeLogger.onStartSuggestion(prevWordForBigram);
         mIsFirstCharCapitalized = false;
         mIsAllUpperCase = false;
@@ -272,15 +270,10 @@ public class Suggest implements Dictionary.WordCallback {
         collectGarbage(mSuggestions, mPrefMaxSuggestions);
         Arrays.fill(mScores, 0);
 
-        final String typedWord = "";
-        final String consideredWord = "";
         // Treating USER_TYPED as UNIGRAM suggestion for logging now.
-        LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
-                Dictionary.UNIGRAM);
+        LatinImeLogger.onAddSuggestedWord("", Suggest.DIC_USER_TYPED, Dictionary.UNIGRAM);
         mConsideredWord = "";
 
-        final boolean allowsToBeAutoCorrected = false;
-
         if (correctionMode == CORRECTION_FULL_BIGRAM) {
             // At first character typed, search only the bigrams
             Arrays.fill(mBigramScores, 0);
@@ -292,7 +285,7 @@ public class Suggest implements Dictionary.WordCallback {
                     prevWordForBigram = lowerPrevWord;
                 }
                 for (final Dictionary dictionary : mBigramDictionaries.values()) {
-                    dictionary.getBigrams(wordComposer, prevWordForBigram, this);
+                    dictionary.getBigrams(sEmptyWordComposer, prevWordForBigram, this);
                 }
                 // Nothing entered: return all bigrams for the previous word
                 int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
@@ -301,12 +294,11 @@ public class Suggest implements Dictionary.WordCallback {
                 }
             }
         }
-        CharSequence whitelistedWord = null;
 
         StringUtils.removeDupes(mSuggestions);
 
         return new SuggestedWords.Builder().addWords(mSuggestions, null)
-                .setAllowsToBeAutoCorrected(allowsToBeAutoCorrected)
+                .setAllowsToBeAutoCorrected(false)
                 .setHasAutoCorrection(false);
     }