From 5f00fe09e9a611b647592188316e5999465df4d3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 20 Oct 2014 14:48:56 +0900 Subject: Fix some compiler warnings This CL fixes the following compiler warnings. - Indirect access to static member - Access to a non-accessible member of an enclosing type - Parameter assignment - Method can be static - Local variable declaration hides another field or variable - Value of local variable is not used - Unused import - Unused private member - Unnecessary 'else' statement - Unnecessary declaration of throw exception - Redundant type arguments - Missing '@Override' annotation - Unused '@SuppressWarning' annotations Bug: 18003991 Change-Id: Icfebe753e53a2cc621848f769d6a3d7ce501ebc7 --- .../latin/makedict/BinaryDictDecoderUtils.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java') diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java index 1f3ee19af..21411f24c 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java @@ -113,15 +113,16 @@ public final class BinaryDictDecoderUtils { /** * Helper method to find out whether this code fits on one byte */ - private static boolean fitsOnOneByte(int character, + private static boolean fitsOnOneByte(final int character, final HashMap codePointToOneByteCodeMap) { + int codePoint = character; if (codePointToOneByteCodeMap != null) { if (codePointToOneByteCodeMap.containsKey(character)) { - character = codePointToOneByteCodeMap.get(character); + codePoint = codePointToOneByteCodeMap.get(character); } } - return character >= FormatSpec.MINIMAL_ONE_BYTE_CHARACTER_VALUE - && character <= FormatSpec.MAXIMAL_ONE_BYTE_CHARACTER_VALUE; + return codePoint >= FormatSpec.MINIMAL_ONE_BYTE_CHARACTER_VALUE + && codePoint <= FormatSpec.MAXIMAL_ONE_BYTE_CHARACTER_VALUE; } /** @@ -168,8 +169,9 @@ public final class BinaryDictDecoderUtils { * @param codePointToOneByteCodeMap the map to convert the code point. * @return the index after the last character. */ - static int writeCharArray(final int[] codePoints, final byte[] buffer, int index, + static int writeCharArray(final int[] codePoints, final byte[] buffer, final int fromIndex, final HashMap codePointToOneByteCodeMap) { + int index = fromIndex; for (int codePoint : codePoints) { if (codePointToOneByteCodeMap != null) { if (codePointToOneByteCodeMap.containsKey(codePoint)) { @@ -293,10 +295,9 @@ public final class BinaryDictDecoderUtils { final int msb = dictBuffer.readUnsignedByte(); if (FormatSpec.MAX_PTNODES_FOR_ONE_BYTE_PTNODE_COUNT >= msb) { return msb; - } else { - return ((FormatSpec.MAX_PTNODES_FOR_ONE_BYTE_PTNODE_COUNT & msb) << 8) - + dictBuffer.readUnsignedByte(); } + return ((FormatSpec.MAX_PTNODES_FOR_ONE_BYTE_PTNODE_COUNT & msb) << 8) + + dictBuffer.readUnsignedByte(); } /** -- cgit v1.2.3-83-g751a