Merge "Fix Error Prone ArrayEquals/ArrayHashCode bugs" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-05-31 15:37:42 +00:00
committed by Android (Google) Code Review

View File

@@ -35,6 +35,7 @@ import android.util.Log;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
/** /**
@@ -501,7 +502,7 @@ public class JobInfo implements Parcelable {
if (constraintFlags != j.constraintFlags) { if (constraintFlags != j.constraintFlags) {
return false; return false;
} }
if (!Objects.deepEquals(triggerContentUris, j.triggerContentUris)) { if (!Arrays.equals(triggerContentUris, j.triggerContentUris)) {
return false; return false;
} }
if (triggerContentUpdateDelay != j.triggerContentUpdateDelay) { if (triggerContentUpdateDelay != j.triggerContentUpdateDelay) {
@@ -556,37 +557,37 @@ public class JobInfo implements Parcelable {
public int hashCode() { public int hashCode() {
int hashCode = jobId; int hashCode = jobId;
if (extras != null) { if (extras != null) {
hashCode = 31*hashCode + extras.hashCode(); hashCode = 31 * hashCode + extras.hashCode();
} }
if (transientExtras != null) { if (transientExtras != null) {
hashCode = 31*hashCode + transientExtras.hashCode(); hashCode = 31 * hashCode + transientExtras.hashCode();
} }
if (clipData != null) { if (clipData != null) {
hashCode = 31*hashCode + clipData.hashCode(); hashCode = 31 * hashCode + clipData.hashCode();
} }
hashCode = 31*hashCode + clipGrantFlags; hashCode = 31*hashCode + clipGrantFlags;
if (service != null) { if (service != null) {
hashCode = 31*hashCode + service.hashCode(); hashCode = 31 * hashCode + service.hashCode();
} }
hashCode = 31*hashCode + constraintFlags; hashCode = 31 * hashCode + constraintFlags;
if (triggerContentUris != null) { if (triggerContentUris != null) {
hashCode = 31*hashCode + triggerContentUris.hashCode(); hashCode = 31 * hashCode + Arrays.hashCode(triggerContentUris);
} }
hashCode = 31*hashCode + Long.hashCode(triggerContentUpdateDelay); hashCode = 31 * hashCode + Long.hashCode(triggerContentUpdateDelay);
hashCode = 31*hashCode + Long.hashCode(triggerContentMaxDelay); hashCode = 31 * hashCode + Long.hashCode(triggerContentMaxDelay);
hashCode = 31*hashCode + Boolean.hashCode(hasEarlyConstraint); hashCode = 31 * hashCode + Boolean.hashCode(hasEarlyConstraint);
hashCode = 31*hashCode + Boolean.hashCode(hasLateConstraint); hashCode = 31 * hashCode + Boolean.hashCode(hasLateConstraint);
hashCode = 31*hashCode + networkType; hashCode = 31 * hashCode + networkType;
hashCode = 31*hashCode + Long.hashCode(minLatencyMillis); hashCode = 31 * hashCode + Long.hashCode(minLatencyMillis);
hashCode = 31*hashCode + Long.hashCode(maxExecutionDelayMillis); hashCode = 31 * hashCode + Long.hashCode(maxExecutionDelayMillis);
hashCode = 31*hashCode + Boolean.hashCode(isPeriodic); hashCode = 31 * hashCode + Boolean.hashCode(isPeriodic);
hashCode = 31*hashCode + Boolean.hashCode(isPersisted); hashCode = 31 * hashCode + Boolean.hashCode(isPersisted);
hashCode = 31*hashCode + Long.hashCode(intervalMillis); hashCode = 31 * hashCode + Long.hashCode(intervalMillis);
hashCode = 31*hashCode + Long.hashCode(flexMillis); hashCode = 31 * hashCode + Long.hashCode(flexMillis);
hashCode = 31*hashCode + Long.hashCode(initialBackoffMillis); hashCode = 31 * hashCode + Long.hashCode(initialBackoffMillis);
hashCode = 31*hashCode + backoffPolicy; hashCode = 31 * hashCode + backoffPolicy;
hashCode = 31*hashCode + priority; hashCode = 31 * hashCode + priority;
hashCode = 31*hashCode + flags; hashCode = 31 * hashCode + flags;
return hashCode; return hashCode;
} }