Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
1616e2e9
Commit
1616e2e9
authored
13 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Fix an excessive fallback problem."
parents
c84bc346
0ee3b694
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/DictionaryFactory.java
+4
-18
4 additions, 18 deletions
.../src/com/android/inputmethod/latin/DictionaryFactory.java
with
4 additions
and
18 deletions
java/src/com/android/inputmethod/latin/DictionaryFactory.java
+
4
−
18
View file @
1616e2e9
...
...
@@ -64,24 +64,10 @@ public class DictionaryFactory {
}
}
// null == dictList is not supposed to be possible, but better safe than sorry and it's
// safer for future extension. In this case, rather than returning null, it should be safer
// to return an empty DictionaryCollection.
if
(
null
==
dictList
)
{
return
new
DictionaryCollection
();
}
else
{
if
(
dictList
.
isEmpty
())
{
// The list may be empty if no dictionaries have been added. The getter should not
// return an empty list, but if it does we end up here. Likewise, if the files
// we found could not be opened by the native code for any reason (format mismatch,
// file too big to fit in memory, etc) then we could have an empty list. In this
// case we want to fall back on the resource.
return
new
DictionaryCollection
(
createBinaryDictionary
(
context
,
fallbackResId
,
locale
));
}
else
{
return
new
DictionaryCollection
(
dictList
);
}
}
// If the list is empty, that means we should not use any dictionary (for example, the user
// explicitly disabled the main dictionary), so the following is okay. dictList is never
// null, but if for some reason it is, DictionaryCollection handles it gracefully.
return
new
DictionaryCollection
(
dictList
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment