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
diff --git a/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java b/tests/cts/tethering/src/android/tethering/cts/TetheringManagerTest.java
index 9efb8f3..043d04f 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.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 @@
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()));
}
}
}