From 284371356c820cdc348580edd0710c8925a08b1e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 18 Dec 2019 14:08:48 -0800 Subject: [PATCH] Fix Error Prone errors Soong wasn't including android_app or android_test sources in the javac-check target used for the Error Prone build, which allowed some Error Prone errors to get in. Fix them so Error Prone can be re-enabled for these targets. Fixes: cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/LockTaskHostDrivenTest.java:50: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations. cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/LockTaskTest.java:51: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations. cts/tests/tests/telephony/current/src/android/telephony/cts/CarrierServiceTest.java:34: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations. cts/tests/tests/tethering/src/android/tethering/cts/TetheringManagerTest.java:166: error: [ArrayToString] Calling toString on an array does not provide useful information cts/tests/tests/tethering/src/android/tethering/cts/TetheringManagerTest.java:172: error: [ArrayToString] Calling toString on an array does not provide useful information Bug: 146455923 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I949e409fd7ba80ab8937db1c08eaaaf9608b17ed --- .../src/android/tethering/cts/TetheringManagerTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java b/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java index 9efb8f38ac..043d04f831 100644 --- a/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java +++ b/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; @@ -163,13 +164,13 @@ public class TetheringManagerTest { if (state == null || state.mErrored == null) return; if (state.mErrored.size() > 0) { - fail("Found failed tethering interfaces: " + state.mErrored.toArray()); + fail("Found failed tethering interfaces: " + Arrays.toString(state.mErrored.toArray())); } } private void assertNoActiveIfaces(final TetherState state) { if (state.mActive != null && state.mActive.size() > 0) { - fail("Found active tethering interface: " + state.mActive.toArray()); + fail("Found active tethering interface: " + Arrays.toString(state.mActive.toArray())); } } }