diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java index d19672181..e88ab685a 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java +++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java @@ -21,7 +21,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; -import java.util.List; /** * A dictionary that can fusion heads and tails of words for more compression. @@ -400,16 +399,11 @@ public class FusionDictionary implements Iterable { * is ignored. * This comparator imposes orderings that are inconsistent with equals. */ - static private class CharGroupComparator implements java.util.Comparator { - public int compare(Object o1, Object o2) { - final CharGroup c1 = (CharGroup)o1; - final CharGroup c2 = (CharGroup)o2; + static private class CharGroupComparator implements java.util.Comparator { + public int compare(CharGroup c1, CharGroup c2) { if (c1.mChars[0] == c2.mChars[0]) return 0; return c1.mChars[0] < c2.mChars[0] ? -1 : 1; } - public boolean equals(Object o) { - return o instanceof CharGroupComparator; - } } final static private CharGroupComparator CHARGROUP_COMPARATOR = new CharGroupComparator(); @@ -417,7 +411,7 @@ public class FusionDictionary implements Iterable { * Finds the insertion index of a character within a node. */ private static int findInsertionIndex(final Node node, int character) { - final List data = node.mData; + final ArrayList data = node.mData; final CharGroup reference = new CharGroup(new int[] { character }, null, null, 0, false /* isShortcutOnly */); int result = Collections.binarySearch(data, reference, CHARGROUP_COMPARATOR); diff --git a/tools/makedict/Android.mk b/tools/makedict/Android.mk index facbbf7b8..dcfad19f0 100644 --- a/tools/makedict/Android.mk +++ b/tools/makedict/Android.mk @@ -12,16 +12,19 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# -#LOCAL_PATH := $(call my-dir) -#include $(CLEAR_VARS) -# -#LOCAL_SRC_FILES := $(call all-java-files-under,src) -#LOCAL_SRC_FILES += $(call all-java-files-under,tests) -#LOCAL_JAR_MANIFEST := etc/manifest.txt -#LOCAL_MODULE_TAGS := eng -#LOCAL_MODULE := makedict -#LOCAL_JAVA_LIBRARIES := junit -# -#include $(BUILD_HOST_JAVA_LIBRARY) -#include $(LOCAL_PATH)/etc/Android.mk + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +MAKEDICT_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin/makedict + +LOCAL_SRC_FILES := $(call all-java-files-under,$(MAKEDICT_CORE_SOURCE_DIRECTORY)) +LOCAL_SRC_FILES += $(call all-java-files-under,src) +LOCAL_SRC_FILES += $(call all-java-files-under,tests) +LOCAL_JAR_MANIFEST := etc/manifest.txt +LOCAL_MODULE_TAGS := eng +LOCAL_MODULE := makedict +LOCAL_JAVA_LIBRARIES := junit + +include $(BUILD_HOST_JAVA_LIBRARY) +include $(LOCAL_PATH)/etc/Android.mk