From 9b89e3d64356072b135217d8f180a474d281bf26 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 6 Sep 2024 13:33:14 -0700 Subject: [PATCH] Fix errorprone issues IgnoredPureGetter, LenientFormatStringValidation, ProtocolBufferOrdinal, and ReturnValueIgnored. https://errorprone.info/bugpatterns Bug: 253827323 Test: RUN_ERROR_PRONE=true m javac-check Change-Id: Ib0a0335aa04b36924adcbfecc830b7392c0e5bec --- src/com/android/settings/bluetooth/Utils.java | 2 +- .../settings/wifi/NetworkRequestErrorDialogFragmentTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/bluetooth/Utils.java b/src/com/android/settings/bluetooth/Utils.java index f6288b2c85c..ea293b16982 100644 --- a/src/com/android/settings/bluetooth/Utils.java +++ b/src/com/android/settings/bluetooth/Utils.java @@ -289,7 +289,7 @@ public final class Utils { } ThreadUtils.postOnBackgroundThread(() -> { for (Supplier supplier : suppliers) { - supplier.get(); + Object unused = supplier.get(); } ThreadUtils.postOnMainThread(runnable); }); diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java index ada47d01da2..099095c7f4f 100644 --- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java +++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java @@ -74,7 +74,7 @@ public class NetworkRequestErrorDialogFragmentTest { @Test public void getConstructor_shouldNotThrowNoSuchMethodException() { try { - NetworkRequestErrorDialogFragment.class.getConstructor(); + Object unused = NetworkRequestErrorDialogFragment.class.getConstructor(); } catch (NoSuchMethodException e) { fail("No default constructor for configuration change!"); }