OSDN Git Service

Fix divergent equals and hashCode behavior
authorPavlin Radoslavov <pavlin@google.com>
Fri, 6 May 2016 19:05:47 +0000 (12:05 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Fri, 6 May 2016 19:45:43 +0000 (12:45 -0700)
commit2f463d4c8b0e9a515cb9c0548aa752678f722a7c
tree3167da7225c0299eb4694733bf44085e3e678931
parent5df0ee53acc90e174f59be6c3c0fe52fd778a66e
Fix divergent equals and hashCode behavior

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

Also, replaced usage of Objects.deepEquals(mServiceDataUuid, ...) with
Objects.equals(mServiceDataUuid, ...), because mServiceDataUuid
is an Object of type ParcelUuid.

Bug: 28585195
Change-Id: Id92734874339985fedafe1a28286a6a4dcd88d3b
core/java/android/bluetooth/le/ScanFilter.java