Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f3545f2 authored by Ian Rogers's avatar Ian Rogers
Browse files

Fix divergent equals and hashCode behavior.

Calling Objects.hash with a byte[] will call the identity hashCode on the
byte[] (rssiBuckets) and this doesn't agree with the use of Arrays.equals
in equals.
Bug caught by error prone.

Bug: 27723540
Change-Id: I1c82a5b9f5ba1bb4428c6954f6dc110790a5e728
parent 51737e64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ public class RssiCurve implements Parcelable {

    @Override
    public int hashCode() {
        return Objects.hash(start, bucketWidth, rssiBuckets, activeNetworkRssiBoost);
        return Objects.hash(start, bucketWidth, activeNetworkRssiBoost) ^ Arrays.hashCode(rssiBuckets);
    }

    @Override