aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-12-15 10:08:26 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-15 10:08:26 -0800
commitb60ab9752c6e3ab035678c270684df1c39189c8b (patch)
treea5be90e292d430c34c2cf12c3b9147701fd784f2 /java/src
parent6168c33aac3787c2dd03b50b01ec6e4ca755e085 (diff)
parent676917dea2595d7bbc1f24a44034a4254a1884fa (diff)
downloadlatinime-b60ab9752c6e3ab035678c270684df1c39189c8b.tar.gz
latinime-b60ab9752c6e3ab035678c270684df1c39189c8b.tar.xz
latinime-b60ab9752c6e3ab035678c270684df1c39189c8b.zip
am 676917de: Merge "Fail faster in case of a bug"
* commit '676917dea2595d7bbc1f24a44034a4254a1884fa': Fail faster in case of a bug
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ff850b7d0..9633e665a 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1606,10 +1606,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (pickedDefaultSuggestion) {
final CharSequence autoCorrection = mWordComposer.getAutoCorrectionOrNull();
final String typedWord = mWordComposer.getTypedWord();
- if (TextUtils.isEmpty(typedWord)) {
- throw new RuntimeException("We have non-committed chars but the typed word "
- + "is empty? Impossible! I must commit suicide.");
- }
if (!typedWord.equals(autoCorrection)) {
// This will make the correction flash for a short while as a visual clue
// to the user that auto-correction happened.
@@ -1882,6 +1878,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final CharSequence autoCorrection = mWordComposer.getAutoCorrectionOrNull();
if (autoCorrection != null) {
final String typedWord = mWordComposer.getTypedWord();
+ if (TextUtils.isEmpty(typedWord)) {
+ throw new RuntimeException("We have an auto-correction but the typed word "
+ + "is empty? Impossible! I must commit suicide.");
+ }
Utils.Stats.onAutoCorrection(typedWord, autoCorrection.toString(), separatorCode);
mExpectingUpdateSelection = true;
commitBestWord(autoCorrection);