Skip to content

Commit ce22ebc

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "Fix errorprone warnings that should be errors" am: 6d585ed am: 78a43f6
Original change: https://android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/2256807 Change-Id: Ie8d7a908adb83e2556d7b2d27beecc0e29978173 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents 2549e98 + 78a43f6 commit ce22ebc

6 files changed

Lines changed: 7 additions & 6 deletions

File tree

java/src/com/android/inputmethod/keyboard/PointerTracker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ private void callListenerOnCodeInput(final Key key, final int primaryCode, final
281281
if (DEBUG_LISTENER) {
282282
final String output = code == Constants.CODE_OUTPUT_TEXT
283283
? key.getOutputText() : Constants.printableCode(code);
284-
Log.d(TAG, String.format("[%d] onCodeInput: %4d %4d %s%s%s", mPointerId, x, y,
284+
Log.d(TAG, String.format("[%d] onCodeInput: %4d %4d %s%s%s%s", mPointerId, x, y,
285285
output, ignoreModifierKey ? " ignoreModifier" : "",
286286
altersCode ? " altersCode" : "", key.isEnabled() ? "" : " disabled"));
287287
}

java/src/com/android/inputmethod/latin/utils/CursorAnchorInfoUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private static CursorAnchorInfo extractFromTextViewInternal(@Nonnull final TextV
216216
if (isTopLeftVisible || isBottomRightVisible) {
217217
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION;
218218
}
219-
if (!isTopLeftVisible || !isTopLeftVisible) {
219+
if (!isTopLeftVisible || !isBottomRightVisible) {
220220
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION;
221221
}
222222
if (isRtl) {

tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ ExpectedKeyOutput preserveCase() {
131131

132132
@Override
133133
boolean hasSameKeyOutput(final String text) {
134-
return text.equals(text);
134+
return mText.equals(text);
135135
}
136136

137137
@Override

tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.HashMap;
3535
import java.util.Iterator;
3636
import java.util.Map.Entry;
37+
import java.util.Objects;
3738

3839
/**
3940
* An implementation of DictEncoder for version 2 binary dictionary.
@@ -100,7 +101,7 @@ static CodePointTable makeCodePointTable(final FusionDictionary dict) {
100101
Collections.sort(codePointOccurrenceArray, new Comparator<Entry<Integer, Integer>>() {
101102
@Override
102103
public int compare(final Entry<Integer, Integer> a, final Entry<Integer, Integer> b) {
103-
if (a.getValue() != b.getValue()) {
104+
if (!Objects.equals(a.getValue(), b.getValue())) {
104105
return b.getValue().compareTo(a.getValue());
105106
}
106107
return b.getKey().compareTo(a.getKey());

tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void runTestHeaderReaderProcessorWithOneSpec(final boolean compress, fina
162162
options.put("locale", "en_US");
163163
options.put("version", Integer.toString(mRandom.nextInt()));
164164
// Add some random options for test
165-
final int numberOfOptionsToAdd = mRandom.nextInt() % (MAX_NUMBER_OF_OPTIONS_TO_ADD + 1);
165+
final int numberOfOptionsToAdd = mRandom.nextInt(MAX_NUMBER_OF_OPTIONS_TO_ADD + 1);
166166
for (int i = 0; i < numberOfOptionsToAdd; ++i) {
167167
options.put(sWords.get(2 * i), sWords.get(2 * 1 + 1));
168168
}

tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void prepare(final long seed) {
4747
*/
4848
private String generateWord(final Random random) {
4949
StringBuilder builder = new StringBuilder("a");
50-
int count = random.nextInt() % 30;
50+
int count = random.nextInt(30);
5151
while (count > 0) {
5252
final long r = Math.abs(random.nextInt());
5353
if (r < 0) continue;

0 commit comments

Comments
 (0)