diff options
author | 2013-10-09 19:32:45 -0700 | |
---|---|---|
committer | 2013-10-09 19:32:45 -0700 | |
commit | 6877060b7b99677dca84e8db33414ca23b118ad3 (patch) | |
tree | 946f55161f9794d0ca3c4e69834d90b985561fb1 /java/src | |
parent | 3aa8c4cc1f2f39168ac01770431123a3c9a73487 (diff) | |
parent | 4afd8ff474eb0e363a14393298b3f372ce813d1d (diff) | |
download | latinime-6877060b7b99677dca84e8db33414ca23b118ad3.tar.gz latinime-6877060b7b99677dca84e8db33414ca23b118ad3.tar.xz latinime-6877060b7b99677dca84e8db33414ca23b118ad3.zip |
am 4afd8ff4: am 0874939e: am a8b838b4: Merge "Fix a test and crash with a better error message when reading"
* commit '4afd8ff474eb0e363a14393298b3f372ce813d1d':
Fix a test and crash with a better error message when reading
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java | 3 |
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; |