aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-07-28 17:33:52 +0900
committerJean Chalard <jchalard@google.com>2014-07-28 17:33:52 +0900
commitda70b90aa77f2caf88ebd0d102c7a28e0f9726ad (patch)
treeeed4c81c053aef9ec6c72906f0a31b2299340407
parent825243bfdd6fb63c2ef8bf99024bb06e6f52e946 (diff)
downloadlatinime-da70b90aa77f2caf88ebd0d102c7a28e0f9726ad.tar.gz
latinime-da70b90aa77f2caf88ebd0d102c7a28e0f9726ad.tar.xz
latinime-da70b90aa77f2caf88ebd0d102c7a28e0f9726ad.zip
Fix a verifier error on ICS.
Bug: 16530557 Change-Id: I271c5884995a1d5f8a1cb7aee6f52d17fabb9e72
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java4
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/SentenceLevelAdapter.java11
2 files changed, 11 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
index 14ab2dbbf..34e01197a 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java
@@ -153,7 +153,7 @@ public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheck
*/
private SentenceSuggestionsInfo[] splitAndSuggest(TextInfo[] textInfos, int suggestionsLimit) {
if (textInfos == null || textInfos.length == 0) {
- return SentenceLevelAdapter.EMPTY_SENTENCE_SUGGESTIONS_INFOS;
+ return SentenceLevelAdapter.getEmptySentenceSuggestionsInfo();
}
SentenceLevelAdapter sentenceLevelAdapter;
synchronized(this) {
@@ -168,7 +168,7 @@ public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheck
}
}
if (sentenceLevelAdapter == null) {
- return SentenceLevelAdapter.EMPTY_SENTENCE_SUGGESTIONS_INFOS;
+ return SentenceLevelAdapter.getEmptySentenceSuggestionsInfo();
}
final int infosSize = textInfos.length;
final SentenceSuggestionsInfo[] retval = new SentenceSuggestionsInfo[infosSize];
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SentenceLevelAdapter.java b/java/src/com/android/inputmethod/latin/spellcheck/SentenceLevelAdapter.java
index ae582ea25..51c4b1ee8 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/SentenceLevelAdapter.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/SentenceLevelAdapter.java
@@ -35,9 +35,16 @@ import java.util.Locale;
* rewrite everything for any small change.
*/
public class SentenceLevelAdapter {
- public static final SentenceSuggestionsInfo[] EMPTY_SENTENCE_SUGGESTIONS_INFOS =
- new SentenceSuggestionsInfo[] {};
+ private static class EmptySentenceSuggestionsInfosInitializationHolder {
+ public static final SentenceSuggestionsInfo[] EMPTY_SENTENCE_SUGGESTIONS_INFOS =
+ new SentenceSuggestionsInfo[]{};
+ }
private static final SuggestionsInfo EMPTY_SUGGESTIONS_INFO = new SuggestionsInfo(0, null);
+
+ public static SentenceSuggestionsInfo[] getEmptySentenceSuggestionsInfo() {
+ return EmptySentenceSuggestionsInfosInitializationHolder.EMPTY_SENTENCE_SUGGESTIONS_INFOS;
+ }
+
/**
* Container for split TextInfo parameters
*/