am 4aff3bf0: Clean up unnecessary uses of toString()

* commit '4aff3bf0eaf4aec38c1d8576fdfc85a9eaa1c544':
  Clean up unnecessary uses of toString()
main
Kurt Partridge 2012-12-23 18:45:47 -08:00 committed by Android Git Automerger
commit 31b858cd6f
1 changed files with 10 additions and 12 deletions

View File

@ -1454,7 +1454,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
public void onTextInput(final String rawText) {
mConnection.beginBatchEdit();
if (mWordComposer.isComposingWord()) {
commitCurrentAutoCorrection(rawText.toString());
commitCurrentAutoCorrection(rawText);
} else {
resetComposingState(true /* alsoResetLastComposedWord */);
}
@ -2104,13 +2104,12 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
+ "is empty? Impossible! I must commit suicide.");
}
if (ProductionFlag.IS_INTERNAL) {
Stats.onAutoCorrection(
typedWord, autoCorrection.toString(), separatorString, mWordComposer);
Stats.onAutoCorrection(typedWord, autoCorrection, separatorString, mWordComposer);
}
mExpectingUpdateSelection = true;
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinIme_commitCurrentAutoCorrection(typedWord,
autoCorrection.toString(), separatorString);
ResearchLogger.latinIme_commitCurrentAutoCorrection(typedWord, autoCorrection,
separatorString);
}
commitChosenWord(autoCorrection, LastComposedWord.COMMIT_TYPE_DECIDED_WORD,
@ -2177,7 +2176,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
// We need to log before we commit, because the word composer will store away the user
// typed word.
final String replacedWord = mWordComposer.getTypedWord().toString();
final String replacedWord = mWordComposer.getTypedWord();
LatinImeLogger.logOnManualSuggestion(replacedWord, suggestion, index, suggestedWords);
mExpectingUpdateSelection = true;
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
@ -2227,8 +2226,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
// what user typed. Note: currently this is done much later in
// LastComposedWord#didCommitTypedWord by string equality of the remembered
// strings.
mLastComposedWord = mWordComposer.commitWord(commitType, chosenWord.toString(),
separatorString, prevWord);
mLastComposedWord = mWordComposer.commitWord(commitType, chosenWord, separatorString,
prevWord);
}
private void setPunctuationSuggestions() {
@ -2252,7 +2251,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
final UserHistoryDictionary userHistoryDictionary = mUserHistoryDictionary;
if (userHistoryDictionary != null) {
final CharSequence prevWord
final String prevWord
= mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 2);
final String secondWord;
if (mWordComposer.wasAutoCapitalized() && !mWordComposer.isMostlyCaps()) {
@ -2265,9 +2264,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
final int maxFreq = AutoCorrection.getMaxFrequency(
mSuggest.getUnigramDictionaries(), suggestion);
if (maxFreq == 0) return null;
final String prevWordString = (null == prevWord) ? null : prevWord.toString();
userHistoryDictionary.addToUserHistory(prevWordString, secondWord, maxFreq > 0);
return prevWordString;
userHistoryDictionary.addToUserHistory(prevWord, secondWord, maxFreq > 0);
return prevWord;
}
return null;
}