aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/NgramContext.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-10-20 14:48:56 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-10-21 19:28:37 +0900
commit5f00fe09e9a611b647592188316e5999465df4d3 (patch)
tree954a429256171897c7b9ed56a732e386eec76b2b /java/src/com/android/inputmethod/latin/NgramContext.java
parentfa1e65cb3a5dcce6299a6dd067cee95720107307 (diff)
downloadlatinime-5f00fe09e9a611b647592188316e5999465df4d3.tar.gz
latinime-5f00fe09e9a611b647592188316e5999465df4d3.tar.xz
latinime-5f00fe09e9a611b647592188316e5999465df4d3.zip
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
Diffstat (limited to 'java/src/com/android/inputmethod/latin/NgramContext.java')
-rw-r--r--java/src/com/android/inputmethod/latin/NgramContext.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/NgramContext.java b/java/src/com/android/inputmethod/latin/NgramContext.java
index a02531cc4..2dc409f9f 100644
--- a/java/src/com/android/inputmethod/latin/NgramContext.java
+++ b/java/src/com/android/inputmethod/latin/NgramContext.java
@@ -31,14 +31,14 @@ public class NgramContext {
public static final NgramContext EMPTY_PREV_WORDS_INFO =
new NgramContext(WordInfo.EMPTY_WORD_INFO);
public static final NgramContext BEGINNING_OF_SENTENCE =
- new NgramContext(WordInfo.BEGINNING_OF_SENTENCE);
+ new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO);
/**
* Word information used to represent previous words information.
*/
public static class WordInfo {
public static final WordInfo EMPTY_WORD_INFO = new WordInfo(null);
- public static final WordInfo BEGINNING_OF_SENTENCE = new WordInfo();
+ public static final WordInfo BEGINNING_OF_SENTENCE_WORD_INFO = new WordInfo();
// This is an empty char sequence when mIsBeginningOfSentence is true.
public final CharSequence mWord;
@@ -48,7 +48,7 @@ public class NgramContext {
public final boolean mIsBeginningOfSentence;
// Beginning of sentence.
- public WordInfo() {
+ private WordInfo() {
mWord = "";
mIsBeginningOfSentence = true;
}
@@ -96,18 +96,6 @@ public class NgramContext {
mPrevWordsCount = prevWordsInfo.length;
}
- // Construct from WordInfo array and size. The caller shouldn't change prevWordsInfo after
- // calling this method.
- private NgramContext(final NgramContext ngramContext, final int prevWordsCount) {
- if (ngramContext.mPrevWordsCount < prevWordsCount) {
- throw new IndexOutOfBoundsException("ngramContext.mPrevWordsCount ("
- + ngramContext.mPrevWordsCount + ") is smaller than prevWordsCount ("
- + prevWordsCount + ")");
- }
- mPrevWordsInfo = ngramContext.mPrevWordsInfo;
- mPrevWordsCount = prevWordsCount;
- }
-
// Create next prevWordsInfo using current prevWordsInfo.
public NgramContext getNextNgramContext(final WordInfo wordInfo) {
final int nextPrevWordCount = Math.min(Constants.MAX_PREV_WORD_COUNT_FOR_N_GRAM,