OSDN Git Service

Use java.util.Objects.hashCode to get hashcode.
authoryinxu <yinxu@google.com>
Wed, 14 Jun 2017 17:31:40 +0000 (10:31 -0700)
committeryinxu <yinxu@google.com>
Wed, 14 Jun 2017 17:54:05 +0000 (10:54 -0700)
Test: Telephony sanity tests
Change-Id: I8b845f2e5e44b242278b8955807d1b40e67e1414

telephony/java/com/android/internal/telephony/NetworkScanResult.java

index 0099961..df80666 100644 (file)
@@ -22,6 +22,7 @@ import android.telephony.CellInfo;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Defines the incremental network scan result.
@@ -111,7 +112,7 @@ public final class NetworkScanResult implements Parcelable {
     public int hashCode () {
         return ((scanStatus * 31)
                 + (scanError * 23)
-                + (networkInfos.hashCode() * 37));
+                + (Objects.hashCode(networkInfos) * 37));
     }
 
     public static final Creator<NetworkScanResult> CREATOR =