aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-02 06:28:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-02 06:28:06 +0000
commita8b838b473d4927e6f0483912c45fba929dfb402 (patch)
tree1bfa185bfff19a88c30a6480903a668b16e66818 /java/src/com/android
parent77144a645f693fd0d73fd2cbe378997c7a339006 (diff)
parentfa946d4a0f6329134ddbae9a3ce03f6d4009019b (diff)
downloadlatinime-a8b838b473d4927e6f0483912c45fba929dfb402.tar.gz
latinime-a8b838b473d4927e6f0483912c45fba929dfb402.tar.xz
latinime-a8b838b473d4927e6f0483912c45fba929dfb402.zip
Merge "Fix a test and crash with a better error message when reading"
Diffstat (limited to 'java/src/com/android')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java3
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java
index 75d1058ad..bf5a28d62 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java
@@ -169,7 +169,8 @@ public class Ver3DictDecoder extends DictDecoder {
addressPointer += PtNodeReader.readBigramAddresses(mDictBuffer, bigrams,
addressPointer);
if (bigrams.size() >= FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) {
- MakedictLog.d("too many bigrams in a PtNode.");
+ throw new RuntimeException("Too many bigrams in a PtNode (" + bigrams.size()
+ + " but max is " + FormatSpec.MAX_BIGRAMS_IN_A_PTNODE + ")");
}
} else {
bigrams = null;
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
index fa19e2677..89370f0dc 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
@@ -224,7 +224,8 @@ public class Ver4DictDecoder extends DictDecoder {
if (0 == (bigramFlags & FormatSpec.FLAG_BIGRAM_SHORTCUT_ATTR_HAS_NEXT)) break;
}
if (bigrams.size() >= FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) {
- MakedictLog.d("too many bigrams in a node.");
+ throw new RuntimeException("Too many bigrams in a PtNode (" + bigrams.size()
+ + " but max is " + FormatSpec.MAX_BIGRAMS_IN_A_PTNODE + ")");
}
} else {
bigrams = null;