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: Ida6513002f8fd845a385924be290b720f06c4748
This commit is contained in:
@@ -243,7 +243,7 @@ public abstract class AppStateAppOpsBridge extends AppStateBaseBridge {
|
|||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "PackageManager is dead. Can't get list of packages granted "
|
Log.w(TAG, "PackageManager is dead. Can't get list of packages granted "
|
||||||
+ mPermissions, e);
|
+ Arrays.toString(mPermissions), e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,7 @@ import com.android.settings.R;
|
|||||||
import com.android.settingslib.core.AbstractPreferenceController;
|
import com.android.settingslib.core.AbstractPreferenceController;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -113,11 +114,11 @@ public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase {
|
|||||||
|
|
||||||
CharSequence[] entriesArr = entries.toArray(new CharSequence[entries.size()]);
|
CharSequence[] entriesArr = entries.toArray(new CharSequence[entries.size()]);
|
||||||
CharSequence[] valuesArr = values.toArray(new CharSequence[values.size()]);
|
CharSequence[] valuesArr = values.toArray(new CharSequence[values.size()]);
|
||||||
if (!Objects.equals(mCalendar.getEntries(), entriesArr)) {
|
if (!Arrays.equals(mCalendar.getEntries(), entriesArr)) {
|
||||||
mCalendar.setEntries(entriesArr);
|
mCalendar.setEntries(entriesArr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.equals(mCalendar.getEntryValues(), valuesArr)) {
|
if (!Arrays.equals(mCalendar.getEntryValues(), valuesArr)) {
|
||||||
mCalendar.setEntryValues(valuesArr);
|
mCalendar.setEntryValues(valuesArr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -231,7 +231,7 @@ public class ZenModeScheduleRuleSettings extends ZenModeRuleSettingsBase {
|
|||||||
protected void onChanged(final int[] days) {
|
protected void onChanged(final int[] days) {
|
||||||
if (mDisableListeners) return;
|
if (mDisableListeners) return;
|
||||||
if (Arrays.equals(days, mSchedule.days)) return;
|
if (Arrays.equals(days, mSchedule.days)) return;
|
||||||
if (DEBUG) Log.d(TAG, "days.onChanged days=" + Arrays.asList(days));
|
if (DEBUG) Log.d(TAG, "days.onChanged days=" + Arrays.toString(days));
|
||||||
mSchedule.days = days;
|
mSchedule.days = days;
|
||||||
updateRule(ZenModeConfig.toScheduleConditionId(mSchedule));
|
updateRule(ZenModeConfig.toScheduleConditionId(mSchedule));
|
||||||
}
|
}
|
||||||
|
@@ -746,7 +746,7 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
if (config.enterpriseConfig.getCaCertificateAliases() != null
|
if (config.enterpriseConfig.getCaCertificateAliases() != null
|
||||||
&& config.enterpriseConfig.getCaPath() != null) {
|
&& config.enterpriseConfig.getCaPath() != null) {
|
||||||
Log.e(TAG, "ca_cert ("
|
Log.e(TAG, "ca_cert ("
|
||||||
+ config.enterpriseConfig.getCaCertificateAliases()
|
+ Arrays.toString(config.enterpriseConfig.getCaCertificateAliases())
|
||||||
+ ") and ca_path ("
|
+ ") and ca_path ("
|
||||||
+ config.enterpriseConfig.getCaPath()
|
+ config.enterpriseConfig.getCaPath()
|
||||||
+ ") should not both be non-null");
|
+ ") should not both be non-null");
|
||||||
|
@@ -731,7 +731,7 @@ public class WifiConfigController2 implements TextWatcher,
|
|||||||
if (config.enterpriseConfig.getCaCertificateAliases() != null
|
if (config.enterpriseConfig.getCaCertificateAliases() != null
|
||||||
&& config.enterpriseConfig.getCaPath() != null) {
|
&& config.enterpriseConfig.getCaPath() != null) {
|
||||||
Log.e(TAG, "ca_cert ("
|
Log.e(TAG, "ca_cert ("
|
||||||
+ config.enterpriseConfig.getCaCertificateAliases()
|
+ Arrays.toString(config.enterpriseConfig.getCaCertificateAliases())
|
||||||
+ ") and ca_path ("
|
+ ") and ca_path ("
|
||||||
+ config.enterpriseConfig.getCaPath()
|
+ config.enterpriseConfig.getCaPath()
|
||||||
+ ") should not both be non-null");
|
+ ") should not both be non-null");
|
||||||
|
Reference in New Issue
Block a user