From c9cee6651cbbf4106e9dbe708e9b9b26079a5bfc Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Thu, 9 Feb 2006 03:36:47 +0000 Subject: [PATCH] SEC-176: Add hashCode() method. --- .../acegisecurity/ui/WebAuthenticationDetails.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java b/core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java index 33bd5d28a8..844267a61a 100644 --- a/core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java +++ b/core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java @@ -137,6 +137,20 @@ public class WebAuthenticationDetails implements SessionIdentifierAware, return sessionId; } + public int hashCode() { + int code = 7654; + + if (this.remoteAddress != null) { + code = code * (this.remoteAddress.hashCode() % 7); + } + + if (this.sessionId != null) { + code = code * (this.sessionId.hashCode() % 7); + } + + return code; + } + public String toString() { StringBuffer sb = new StringBuffer(); sb.append(super.toString() + ": ");