mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-04 09:42:29 +00:00
SEC-176: Add hashCode() method.
This commit is contained in:
parent
ac457021b8
commit
c9cee6651c
@ -137,6 +137,20 @@ public class WebAuthenticationDetails implements SessionIdentifierAware,
|
|||||||
return sessionId;
|
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() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(super.toString() + ": ");
|
sb.append(super.toString() + ": ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user