Skip to content
Snippets Groups Projects
Commit 852630ba authored by Jean Chalard's avatar Jean Chalard
Browse files

Add a sanity check

Check if any character is both a magic space swapper and
a magic space stripper for the current language, and throw
an exception if found. Since this is expensive, it's done
only in debug mode.

Change-Id: Ibd166db87c91495b76878ea0e4f420a62c7bb276
parent 8c111043
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,14 @@ public class SettingsValues {
mDelayUpdateOldSuggestions = res.getInteger(R.integer.config_delay_update_old_suggestions);
mMagicSpaceStrippers = res.getString(R.string.magic_space_stripping_symbols);
mMagicSpaceSwappers = res.getString(R.string.magic_space_swapping_symbols);
if (LatinImeLogger.sDBG) {
for (int i = 0; i < mMagicSpaceStrippers.length(); ++i) {
if (isMagicSpaceSwapper(mMagicSpaceStrippers.codePointAt(i))) {
throw new RuntimeException("Char code " + mMagicSpaceStrippers.codePointAt(i)
+ " is both a magic space swapper and stripper.");
}
}
}
mSuggestPuncs = res.getString(R.string.suggested_punctuations);
// TODO: it would be nice not to recreate this each time we change the configuration
mSuggestPuncList = createSuggestPuncList(mSuggestPuncs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment