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:05:47 +0000 (12:05 -0700)
commitf74b830e681ad321dda5756616371d493fe5110c
tree1b58f6e28df812cd67edc42a49fe752279be6ce0
parente3a25ad692cf88455222522542fe374a41024ccf
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