mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Fix errorprone warnings that should be errors" am: 6d585ed76c am: 78a43f6c9c
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>
This commit is contained in:
commit
ce22ebc557
@ -281,7 +281,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
|||||||
if (DEBUG_LISTENER) {
|
if (DEBUG_LISTENER) {
|
||||||
final String output = code == Constants.CODE_OUTPUT_TEXT
|
final String output = code == Constants.CODE_OUTPUT_TEXT
|
||||||
? key.getOutputText() : Constants.printableCode(code);
|
? key.getOutputText() : Constants.printableCode(code);
|
||||||
Log.d(TAG, String.format("[%d] onCodeInput: %4d %4d %s%s%s", mPointerId, x, y,
|
Log.d(TAG, String.format("[%d] onCodeInput: %4d %4d %s%s%s%s", mPointerId, x, y,
|
||||||
output, ignoreModifierKey ? " ignoreModifier" : "",
|
output, ignoreModifierKey ? " ignoreModifier" : "",
|
||||||
altersCode ? " altersCode" : "", key.isEnabled() ? "" : " disabled"));
|
altersCode ? " altersCode" : "", key.isEnabled() ? "" : " disabled"));
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ public final class CursorAnchorInfoUtils {
|
|||||||
if (isTopLeftVisible || isBottomRightVisible) {
|
if (isTopLeftVisible || isBottomRightVisible) {
|
||||||
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION;
|
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION;
|
||||||
}
|
}
|
||||||
if (!isTopLeftVisible || !isTopLeftVisible) {
|
if (!isTopLeftVisible || !isBottomRightVisible) {
|
||||||
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION;
|
characterBoundsFlags |= CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION;
|
||||||
}
|
}
|
||||||
if (isRtl) {
|
if (isRtl) {
|
||||||
|
@ -131,7 +131,7 @@ abstract class ExpectedKeyOutput {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean hasSameKeyOutput(final String text) {
|
boolean hasSameKeyOutput(final String text) {
|
||||||
return text.equals(text);
|
return mText.equals(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,6 +34,7 @@ import java.util.Comparator;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of DictEncoder for version 2 binary dictionary.
|
* An implementation of DictEncoder for version 2 binary dictionary.
|
||||||
@ -100,7 +101,7 @@ public class Ver2DictEncoder implements DictEncoder {
|
|||||||
Collections.sort(codePointOccurrenceArray, new Comparator<Entry<Integer, Integer>>() {
|
Collections.sort(codePointOccurrenceArray, new Comparator<Entry<Integer, Integer>>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(final Entry<Integer, Integer> a, final Entry<Integer, Integer> b) {
|
public int compare(final Entry<Integer, Integer> a, final Entry<Integer, Integer> b) {
|
||||||
if (a.getValue() != b.getValue()) {
|
if (!Objects.equals(a.getValue(), b.getValue())) {
|
||||||
return b.getValue().compareTo(a.getValue());
|
return b.getValue().compareTo(a.getValue());
|
||||||
}
|
}
|
||||||
return b.getKey().compareTo(a.getKey());
|
return b.getKey().compareTo(a.getKey());
|
||||||
|
@ -162,7 +162,7 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase {
|
|||||||
options.put("locale", "en_US");
|
options.put("locale", "en_US");
|
||||||
options.put("version", Integer.toString(mRandom.nextInt()));
|
options.put("version", Integer.toString(mRandom.nextInt()));
|
||||||
// Add some random options for test
|
// Add some random options for test
|
||||||
final int numberOfOptionsToAdd = mRandom.nextInt() % (MAX_NUMBER_OF_OPTIONS_TO_ADD + 1);
|
final int numberOfOptionsToAdd = mRandom.nextInt(MAX_NUMBER_OF_OPTIONS_TO_ADD + 1);
|
||||||
for (int i = 0; i < numberOfOptionsToAdd; ++i) {
|
for (int i = 0; i < numberOfOptionsToAdd; ++i) {
|
||||||
options.put(sWords.get(2 * i), sWords.get(2 * 1 + 1));
|
options.put(sWords.get(2 * i), sWords.get(2 * 1 + 1));
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class FusionDictionaryTest extends TestCase {
|
|||||||
*/
|
*/
|
||||||
private String generateWord(final Random random) {
|
private String generateWord(final Random random) {
|
||||||
StringBuilder builder = new StringBuilder("a");
|
StringBuilder builder = new StringBuilder("a");
|
||||||
int count = random.nextInt() % 30;
|
int count = random.nextInt(30);
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
final long r = Math.abs(random.nextInt());
|
final long r = Math.abs(random.nextInt());
|
||||||
if (r < 0) continue;
|
if (r < 0) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user