From ea51bfd8a88d2fb4b198e8f8b034bf864d0d2d89 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 14 Mar 2012 19:23:15 +0900 Subject: [PATCH] Fix SuggestedWords.toString Change-Id: Ide3f605ce40e8c230f217bbf37ab016457ee91f1 --- .../android/inputmethod/latin/SuggestedWords.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 201e0f410..6b231f81c 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -16,9 +16,11 @@ package com.android.inputmethod.latin; +import android.text.TextUtils; import android.view.inputmethod.CompletionInfo; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -71,7 +73,9 @@ public class SuggestedWords { return "SuggestedWords:" + " mTypedWordValid=" + mTypedWordValid + " mHasAutoCorrectionCandidate=" + mHasAutoCorrectionCandidate - + " mIsPunctuationSuggestions=" + mIsPunctuationSuggestions; + + " mAllowsToBeAutoCorrected=" + mAllowsToBeAutoCorrected + + " mIsPunctuationSuggestions=" + mIsPunctuationSuggestions + + " words=" + Arrays.toString(mSuggestedWordInfoList.toArray()); } public static ArrayList getFromCharSequenceList( @@ -141,5 +145,14 @@ public class SuggestedWords { public boolean isObsoleteSuggestedWord () { return mPreviousSuggestedWord; } + + @Override + public String toString() { + if (TextUtils.isEmpty(mDebugString)) { + return mWord.toString(); + } else { + return mWord.toString() + " (" + mDebugString.toString() + ")"; + } + } } }