Remove warnings
Thanks Eclipse Change-Id: I88e3979ed22be5d8be5a5accdde417c6b1a8bf2d
This commit is contained in:
parent
74d66a5513
commit
f41389a74b
6 changed files with 11 additions and 18 deletions
|
@ -565,6 +565,7 @@ public final class BinaryDictIOUtils {
|
|||
return size;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static void updateForwardLink(final FusionDictionaryBufferInterface buffer,
|
||||
final int nodeOriginAddress, final int newNodeAddress,
|
||||
final FormatOptions formatOptions) {
|
||||
|
|
|
@ -77,12 +77,12 @@ public final class BinaryDictInputOutput {
|
|||
|
||||
@Override
|
||||
public int readUnsignedByte() {
|
||||
return ((int)mBuffer.get()) & 0xFF;
|
||||
return mBuffer.get() & 0xFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int readUnsignedShort() {
|
||||
return ((int)mBuffer.getShort()) & 0xFFFF;
|
||||
return mBuffer.getShort() & 0xFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -474,11 +474,8 @@ public final class BinaryDictInputOutput {
|
|||
}
|
||||
}
|
||||
|
||||
private static final int SINT8_MAX = 0x7F;
|
||||
private static final int SINT16_MAX = 0x7FFF;
|
||||
private static final int SINT24_MAX = 0x7FFFFF;
|
||||
private static final int MSB8 = 0x80;
|
||||
private static final int MSB16 = 0x8000;
|
||||
private static final int MSB24 = 0x800000;
|
||||
|
||||
// End utility methods.
|
||||
|
@ -1711,7 +1708,7 @@ public final class BinaryDictInputOutput {
|
|||
*
|
||||
* Concretely this only tests the magic number.
|
||||
*
|
||||
* @param filename The name of the file to test.
|
||||
* @param file The file to test.
|
||||
* @return true if it's a binary dictionary, false otherwise
|
||||
*/
|
||||
public static boolean isBinaryDictionary(final File file) {
|
||||
|
@ -1751,8 +1748,7 @@ public final class BinaryDictInputOutput {
|
|||
final int bigramFrequency) {
|
||||
final float stepSize = (FormatSpec.MAX_TERMINAL_FREQUENCY - unigramFrequency)
|
||||
/ (1.5f + FormatSpec.MAX_BIGRAM_FREQUENCY);
|
||||
final float resultFreqFloat = (float)unigramFrequency
|
||||
+ stepSize * (bigramFrequency + 1.0f);
|
||||
final float resultFreqFloat = unigramFrequency + stepSize * (bigramFrequency + 1.0f);
|
||||
return (int)resultFreqFloat;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package com.android.inputmethod.latin.makedict;
|
||||
|
||||
import com.android.inputmethod.annotations.UsedForTesting;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -158,16 +157,15 @@ public final class FusionDictionary implements Iterable<Word> {
|
|||
public ArrayList<WeightedString> getShortcutTargets() {
|
||||
// We don't want write permission to escape outside the package, so we return a copy
|
||||
if (null == mShortcutTargets) return null;
|
||||
final ArrayList<WeightedString> copyOfShortcutTargets = new ArrayList<WeightedString>();
|
||||
copyOfShortcutTargets.addAll(mShortcutTargets);
|
||||
final ArrayList<WeightedString> copyOfShortcutTargets =
|
||||
new ArrayList<WeightedString>(mShortcutTargets);
|
||||
return copyOfShortcutTargets;
|
||||
}
|
||||
|
||||
public ArrayList<WeightedString> getBigrams() {
|
||||
// We don't want write permission to escape outside the package, so we return a copy
|
||||
if (null == mBigrams) return null;
|
||||
final ArrayList<WeightedString> copyOfBigrams = new ArrayList<WeightedString>();
|
||||
copyOfBigrams.addAll(mBigrams);
|
||||
final ArrayList<WeightedString> copyOfBigrams = new ArrayList<WeightedString>(mBigrams);
|
||||
return copyOfBigrams;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package com.android.inputmethod.latin.dicttool;
|
||||
|
||||
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
|
||||
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.ByteBufferWrapper;
|
||||
import com.android.inputmethod.latin.makedict.FusionDictionary;
|
||||
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
|
||||
|
||||
|
@ -33,7 +32,6 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.FileChannel.MapMode;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
|
|
@ -95,7 +95,7 @@ public class Diff extends Dicttool.Command {
|
|||
+ dict1.mOptions.mGermanUmlautProcessing);
|
||||
}
|
||||
final HashMap<String, String> options1 =
|
||||
(HashMap<String, String>)dict1.mOptions.mAttributes.clone();
|
||||
new HashMap<String, String>(dict1.mOptions.mAttributes);
|
||||
for (final String optionKey : dict0.mOptions.mAttributes.keySet()) {
|
||||
if (!dict0.mOptions.mAttributes.get(optionKey).equals(
|
||||
dict1.mOptions.mAttributes.get(optionKey))) {
|
||||
|
@ -112,7 +112,7 @@ public class Diff extends Dicttool.Command {
|
|||
|
||||
private static void diffWords(final FusionDictionary dict0, final FusionDictionary dict1) {
|
||||
for (final Word word0 : dict0) {
|
||||
final CharGroup word1 = dict1.findWordInTree(dict1.mRoot, word0.mWord);
|
||||
final CharGroup word1 = FusionDictionary.findWordInTree(dict1.mRoot, word0.mWord);
|
||||
if (null == word1) {
|
||||
// This word is not in dict1
|
||||
System.out.println("Deleted: " + word0.mWord + " " + word0.mFrequency);
|
||||
|
|
|
@ -63,7 +63,7 @@ public class Info extends Dicttool.Command {
|
|||
}
|
||||
|
||||
private static void showWordInfo(final FusionDictionary dict, final String word) {
|
||||
final CharGroup group = dict.findWordInTree(dict.mRoot, word);
|
||||
final CharGroup group = FusionDictionary.findWordInTree(dict.mRoot, word);
|
||||
if (null == group) {
|
||||
System.out.println(word + " is not in the dictionary");
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue