aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-09 14:48:03 +0900
committerJean Chalard <jchalard@google.com>2012-03-09 14:52:04 +0900
commit92146f29269a799935c00c530d05829d7f17cc9e (patch)
tree7fae6a744668c88debcdc849c169b65e51f15b3e /java/src
parent8cd847c2fab2d3563dce0c0d24083d3aff20fb28 (diff)
downloadlatinime-92146f29269a799935c00c530d05829d7f17cc9e.tar.gz
latinime-92146f29269a799935c00c530d05829d7f17cc9e.tar.xz
latinime-92146f29269a799935c00c530d05829d7f17cc9e.zip
Remove useless tests (B5)
WordComposer#getTypedWord() may not return null. Don't test for it. Change-Id: I6aff14892503d0c275a3328c404ed99d2f40a687
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 471b245d5..9eed322c1 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -281,11 +281,9 @@ public class Suggest implements Dictionary.WordCallback {
final String consideredWord = mTrailingSingleQuotesCount > 0
? typedWord.substring(0, typedWord.length() - mTrailingSingleQuotesCount)
: typedWord;
- if (typedWord != null) {
- // Treating USER_TYPED as UNIGRAM suggestion for logging now.
- LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
- Dictionary.UNIGRAM);
- }
+ // Treating USER_TYPED as UNIGRAM suggestion for logging now.
+ LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
+ Dictionary.UNIGRAM);
mConsideredWord = consideredWord;
if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL_BIGRAM)) {
@@ -344,8 +342,7 @@ public class Suggest implements Dictionary.WordCallback {
}
}
}
- final String consideredWordString =
- consideredWord == null ? null : consideredWord.toString();
+ final String consideredWordString = consideredWord.toString();
CharSequence whitelistedWord = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized,
mWhiteListDictionary.getWhitelistedWord(consideredWordString));
@@ -373,9 +370,7 @@ public class Suggest implements Dictionary.WordCallback {
}
}
- if (typedWord != null) {
- mSuggestions.add(0, typedWord.toString());
- }
+ mSuggestions.add(0, typedWord.toString());
StringUtils.removeDupes(mSuggestions);
if (DBG) {