diff options
author | sgehwolf <unknown> | 2019-05-17 17:52:02 +0200 |
---|---|---|
committer | bell-sw <liberica@bell-sw.com> | 2019-07-22 19:22:26 +0300 |
commit | 05235367037d67d033119dff553bc9a149f46c69 (patch) | |
tree | 660bbc0886479ceddaf276303dfc0f45592ce4c4 /src | |
parent | d05c998925ab402aa2f1ea5b69e230f8d5e12bc1 (diff) | |
download | jdk8u_jdk-05235367037d67d033119dff553bc9a149f46c69.tar.gz |
8203190: SessionId.hashCode generates too many collisions
Reviewed-by: andrew, shade, dfuchs
Diffstat (limited to 'src')
-rw-r--r-- | src/share/classes/sun/security/ssl/SessionId.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/share/classes/sun/security/ssl/SessionId.java b/src/share/classes/sun/security/ssl/SessionId.java index 063e86d520..21a46c042d 100644 --- a/src/share/classes/sun/security/ssl/SessionId.java +++ b/src/share/classes/sun/security/ssl/SessionId.java @@ -27,6 +27,7 @@ package sun.security.ssl; import java.security.SecureRandom; +import java.util.Arrays; import javax.net.ssl.SSLProtocolException; /** @@ -91,11 +92,7 @@ class SessionId @Override public int hashCode () { - int retval = 0; - - for (int i = 0; i < sessionId.length; i++) - retval += sessionId [i]; - return retval; + return Arrays.hashCode(sessionId); } /** Returns true if the parameter is the same session ID */ |