Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and ArraysAsListPrimitiveArray errorprone findings were demoted from errors to warnings. Fix existing occurrences of them so they can be made errors again. Bug: 242630963 Test: RUN_ERROR_PRONE=true m javac-check Change-Id: I95b4d0f8d3dfa957285ca94e0846fd3da4734e57
This commit is contained in:
committed by
Lorenzo Colitti
parent
6956ac5eb5
commit
fe60c0fe31
@@ -1273,8 +1273,10 @@ public class TetheringManager {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mTetherableBluetoothRegexs, mTetherableUsbRegexs,
|
||||
mTetherableWifiRegexs);
|
||||
return Objects.hash(
|
||||
Arrays.hashCode(mTetherableBluetoothRegexs),
|
||||
Arrays.hashCode(mTetherableUsbRegexs),
|
||||
Arrays.hashCode(mTetherableWifiRegexs));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,7 +143,7 @@ public class MdnsServiceRecord extends MdnsRecord {
|
||||
return super.equals(other)
|
||||
&& (servicePriority == otherRecord.servicePriority)
|
||||
&& (serviceWeight == otherRecord.serviceWeight)
|
||||
&& Objects.equals(serviceHost, otherRecord.serviceHost)
|
||||
&& Arrays.equals(serviceHost, otherRecord.serviceHost)
|
||||
&& (servicePort == otherRecord.servicePort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,12 +27,13 @@ import static org.junit.Assert.fail;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import com.android.net.module.util.CollectionUtils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -170,7 +171,7 @@ public class TunUtils {
|
||||
*/
|
||||
private static boolean isEspFailIfSpecifiedPlaintextFound(
|
||||
byte[] pkt, int spi, boolean encap, byte[] plaintext) {
|
||||
if (Collections.indexOfSubList(Arrays.asList(pkt), Arrays.asList(plaintext)) != -1) {
|
||||
if (CollectionUtils.indexOfSubArray(pkt, plaintext) != -1) {
|
||||
fail("Banned plaintext packet found");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user