am 2e4713a5
: Merge "Check the length of the word when add to userhistory." into jb-mr1-dev
* commit '2e4713a54ed38a18f39ef0d52431459c8210dc40': Check the length of the word when add to userhistory.
This commit is contained in:
commit
f5e59e12c4
1 changed files with 4 additions and 0 deletions
|
@ -182,6 +182,10 @@ public class UserHistoryDictionary extends ExpandableDictionary {
|
||||||
* The second word may not be null (a NullPointerException would be thrown).
|
* The second word may not be null (a NullPointerException would be thrown).
|
||||||
*/
|
*/
|
||||||
public int addToUserHistory(final String word1, String word2, boolean isValid) {
|
public int addToUserHistory(final String word1, String word2, boolean isValid) {
|
||||||
|
if (word2.length() >= BinaryDictionary.MAX_WORD_LENGTH ||
|
||||||
|
(word1 != null && word1.length() >= BinaryDictionary.MAX_WORD_LENGTH)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (mBigramListLock.tryLock()) {
|
if (mBigramListLock.tryLock()) {
|
||||||
try {
|
try {
|
||||||
super.addWord(
|
super.addWord(
|
||||||
|
|
Loading…
Reference in a new issue