From cad25fc8a754d6f145bc846f17f270220b15c055 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 27 Sep 2011 18:03:42 +0900 Subject: [PATCH] Fix a bug ending in a NPE in some rare cases. Change-Id: If8109c6aa29d100eb745f17f0af756bcb6e3cabb --- .../src/com/android/inputmethod/latin/FusionDictionary.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/makedict/src/com/android/inputmethod/latin/FusionDictionary.java b/tools/makedict/src/com/android/inputmethod/latin/FusionDictionary.java index 031f35dfe..f6220eea2 100644 --- a/tools/makedict/src/com/android/inputmethod/latin/FusionDictionary.java +++ b/tools/makedict/src/com/android/inputmethod/latin/FusionDictionary.java @@ -217,7 +217,7 @@ public class FusionDictionary implements Iterable { int nodeIndex = findIndexOfChar(mRoot, word[charIndex]); while (CHARACTER_NOT_FOUND != nodeIndex) { currentGroup = currentNode.mData.get(nodeIndex); - differentCharIndex = compareArrays(currentGroup.mChars, word, charIndex) ; + differentCharIndex = compareArrays(currentGroup.mChars, word, charIndex); if (ARRAYS_ARE_EQUAL != differentCharIndex && differentCharIndex < currentGroup.mChars.length) break; if (null == currentGroup.mChildren) break; @@ -268,7 +268,7 @@ public class FusionDictionary implements Iterable { + new String(word, 0, word.length)); } final CharGroup newGroup = new CharGroup(word, - currentGroup.mBigrams, frequency); + currentGroup.mBigrams, frequency, currentGroup.mChildren); currentNode.mData.set(nodeIndex, newGroup); } } else {