Make a variable final (A2)
This is never changed, and probably doesn't need to be. It's public because it's going to be used elsewhere in a future change Change-Id: Iec8d65859c470de5e1fb0b05533356fbc3b8e91b
This commit is contained in:
parent
e7d2ee3ec3
commit
0998c48ac3
1 changed files with 7 additions and 7 deletions
|
@ -73,7 +73,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
private final ConcurrentHashMap<String, Dictionary> mBigramDictionaries =
|
||||
new ConcurrentHashMap<String, Dictionary>();
|
||||
|
||||
private int mPrefMaxSuggestions = 18;
|
||||
public static final int MAX_SUGGESTIONS = 18;
|
||||
|
||||
private static final int PREF_MAX_BIGRAMS = 60;
|
||||
|
||||
|
@ -217,7 +217,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
mIsFirstCharCapitalized = false;
|
||||
mIsAllUpperCase = false;
|
||||
mTrailingSingleQuotesCount = 0;
|
||||
mSuggestions = new ArrayList<SuggestedWordInfo>(mPrefMaxSuggestions);
|
||||
mSuggestions = new ArrayList<SuggestedWordInfo>(MAX_SUGGESTIONS);
|
||||
|
||||
// Treating USER_TYPED as UNIGRAM suggestion for logging now.
|
||||
LatinImeLogger.onAddSuggestedWord("", Suggest.DIC_USER_TYPED, Dictionary.UNIGRAM);
|
||||
|
@ -228,7 +228,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
getAllBigrams(prevWordForBigram, sEmptyWordComposer);
|
||||
|
||||
// Nothing entered: return all bigrams for the previous word
|
||||
int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
|
||||
int insertCount = Math.min(mBigramSuggestions.size(), MAX_SUGGESTIONS);
|
||||
for (int i = 0; i < insertCount; ++i) {
|
||||
addBigramToSuggestions(mBigramSuggestions.get(i));
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
mIsFirstCharCapitalized = wordComposer.isFirstCharCapitalized();
|
||||
mIsAllUpperCase = wordComposer.isAllUpperCase();
|
||||
mTrailingSingleQuotesCount = wordComposer.trailingSingleQuotesCount();
|
||||
mSuggestions = new ArrayList<SuggestedWordInfo>(mPrefMaxSuggestions);
|
||||
mSuggestions = new ArrayList<SuggestedWordInfo>(MAX_SUGGESTIONS);
|
||||
|
||||
final String typedWord = wordComposer.getTypedWord();
|
||||
final String consideredWord = mTrailingSingleQuotesCount > 0
|
||||
|
@ -270,7 +270,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
getAllBigrams(prevWordForBigram, wordComposer);
|
||||
if (TextUtils.isEmpty(consideredWord)) {
|
||||
// Nothing entered: return all bigrams for the previous word
|
||||
int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
|
||||
int insertCount = Math.min(mBigramSuggestions.size(), MAX_SUGGESTIONS);
|
||||
for (int i = 0; i < insertCount; ++i) {
|
||||
addBigramToSuggestions(mBigramSuggestions.get(i));
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
if (bigramSuggestionFirstChar == currentChar
|
||||
|| bigramSuggestionFirstChar == currentCharUpper) {
|
||||
addBigramToSuggestions(bigramSuggestion);
|
||||
if (++count > mPrefMaxSuggestions) break;
|
||||
if (++count > MAX_SUGGESTIONS) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
prefMaxSuggestions = PREF_MAX_BIGRAMS;
|
||||
} else {
|
||||
suggestions = mSuggestions;
|
||||
prefMaxSuggestions = mPrefMaxSuggestions;
|
||||
prefMaxSuggestions = MAX_SUGGESTIONS;
|
||||
}
|
||||
|
||||
int pos = 0;
|
||||
|
|
Loading…
Reference in a new issue