Skip to content
Snippets Groups Projects
Commit f07024e0 authored by Kurt Partridge's avatar Kurt Partridge
Browse files

Compare scrubbed strings when uncommitting LogUnits

A LogUnit is only uncommitted if the LogUnit's word matches what is
expected.  But a LogUnit never stores numbers, only scrubbed words that
replace numbers with a special character.  So when uncommitting, the
text from the TextView must also be scrubbed for the comparison to pass
correctly.

Bug: 9088919

Change-Id: I9b56f10afce6d0cc84eb9ead3b9a9b1e061ae39c
parent a0c3e02d
No related branches found
No related tags found
No related merge requests found
......@@ -863,7 +863,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
// Check that expected word matches.
if (oldLogUnit != null) {
final String oldLogUnitWords = oldLogUnit.getWordsAsString();
if (oldLogUnitWords != null && !oldLogUnitWords.equals(expectedWord)) {
// Because the word is stored in the LogUnit with digits scrubbed, the comparison must
// be made on a scrubbed version of the expectedWord as well.
if (oldLogUnitWords != null && !oldLogUnitWords.equals(
scrubDigitsFromString(expectedWord))) {
return;
}
}
......
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