Merge "Remove a slew of Eclipse warnings."

main
Jean Chalard 2012-06-08 00:35:05 -07:00 committed by Android (Google) Code Review
commit e91f32d8c1
10 changed files with 11 additions and 12 deletions

View File

@ -873,6 +873,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
keyPreview, ViewLayoutUtils.newLayoutParam(mPreviewPlacer, 0, 0)); keyPreview, ViewLayoutUtils.newLayoutParam(mPreviewPlacer, 0, 0));
} }
@SuppressWarnings("deprecation") // setBackgroundDrawable is replaced by setBackground in API16
@Override @Override
public void showKeyPreview(PointerTracker tracker) { public void showKeyPreview(PointerTracker tracker) {
if (!mShowKeyPreviewPopup) return; if (!mShowKeyPreviewPopup) return;

View File

@ -21,8 +21,6 @@ import android.util.Log;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.ResearchLogger;
import com.android.inputmethod.latin.define.ProductionFlag;
/** /**
* Keyboard state machine. * Keyboard state machine.

View File

@ -514,8 +514,10 @@ public class ExpandableDictionary extends Dictionary {
/** /**
* Adds bigrams to the in-memory trie structure that is being used to retrieve any word * Adds bigrams to the in-memory trie structure that is being used to retrieve any word
* @param word1 the first word of this bigram
* @param word2 the second word of this bigram
* @param frequency frequency for this bigram * @param frequency frequency for this bigram
* @param addFrequency if true, it adds to current frequency, else it overwrites the old value * @param fcp an instance of ForgettingCurveParams to use for decay policy
* @return returns the final bigram frequency * @return returns the final bigram frequency
*/ */
private int setBigramAndGetFrequency( private int setBigramAndGetFrequency(

View File

@ -747,6 +747,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (TRACE) Debug.startMethodTracing("/data/trace/latinime"); if (TRACE) Debug.startMethodTracing("/data/trace/latinime");
} }
@Override
public void onTargetApplicationKnown(final ApplicationInfo info) { public void onTargetApplicationKnown(final ApplicationInfo info) {
mTargetApplicationInfo = info; mTargetApplicationInfo = info;
} }

View File

@ -101,13 +101,13 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
private static class NullOutputStream extends OutputStream { private static class NullOutputStream extends OutputStream {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void write(byte[] buffer, int offset, int count) throws IOException { public void write(byte[] buffer, int offset, int count) {
// nop // nop
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void write(byte[] buffer) throws IOException { public void write(byte[] buffer) {
// nop // nop
} }

View File

@ -29,7 +29,6 @@ import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* When you call the constructor of this class, you may want to change the current system locale by * When you call the constructor of this class, you may want to change the current system locale by

View File

@ -440,7 +440,7 @@ public class UserHistoryDictionary extends ExpandableDictionary {
if (nw != null) { if (nw != null) {
final ForgettingCurveParams fcp = nw.getFcParams(); final ForgettingCurveParams fcp = nw.getFcParams();
final byte prevFc = word1Bigrams.get(word2); final byte prevFc = word1Bigrams.get(word2);
final byte fc = (byte)fcp.getFc(); final byte fc = fcp.getFc();
final boolean isValid = fcp.isValid(); final boolean isValid = fcp.isValid();
if (prevFc > 0 && prevFc == fc) { if (prevFc > 0 && prevFc == fc) {
// No need to update since we found no changes for this entry. // No need to update since we found no changes for this entry.

View File

@ -50,7 +50,7 @@ public class UserHistoryForgettingCurveUtils {
} }
private ForgettingCurveParams(long now, boolean isValid) { private ForgettingCurveParams(long now, boolean isValid) {
this((int)pushCount((byte)0, isValid), now, now, isValid); this(pushCount((byte)0, isValid), now, now, isValid);
} }
/** This constructor is called when the user history bigram dictionary is being restored. */ /** This constructor is called when the user history bigram dictionary is being restored. */
@ -201,7 +201,7 @@ public class UserHistoryForgettingCurveUtils {
for (int i = 0; i < FC_LEVEL_MAX; ++i) { for (int i = 0; i < FC_LEVEL_MAX; ++i) {
final double initialFreq; final double initialFreq;
if (i >= 2) { if (i >= 2) {
initialFreq = (double)FC_FREQ_MAX; initialFreq = FC_FREQ_MAX;
} else if (i == 1) { } else if (i == 1) {
initialFreq = (double)FC_FREQ_MAX / 2; initialFreq = (double)FC_FREQ_MAX / 2;
} else if (i == 0) { } else if (i == 0) {

View File

@ -44,10 +44,8 @@ import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
public class Utils { public class Utils {
private Utils() { private Utils() {

View File

@ -788,7 +788,7 @@ public class BinaryDictInputOutput {
// which is the best approximation. This is how we get the most precise result with // which is the best approximation. This is how we get the most precise result with
// only four bits. // only four bits.
final double stepSize = final double stepSize =
(double)(MAX_TERMINAL_FREQUENCY - unigramFrequency) / (1.5 + MAX_BIGRAM_FREQUENCY); (MAX_TERMINAL_FREQUENCY - unigramFrequency) / (1.5 + MAX_BIGRAM_FREQUENCY);
final double firstStepStart = 1 + unigramFrequency + (stepSize / 2.0); final double firstStepStart = 1 + unigramFrequency + (stepSize / 2.0);
final int discretizedFrequency = (int)((bigramFrequency - firstStepStart) / stepSize); final int discretizedFrequency = (int)((bigramFrequency - firstStepStart) / stepSize);
// If the bigram freq is less than half-a-step higher than the unigram freq, we get -1 // If the bigram freq is less than half-a-step higher than the unigram freq, we get -1