diff --git a/core/src/main/java/org/acegisecurity/adapters/AbstractAdapterAuthenticationToken.java b/core/src/main/java/org/acegisecurity/adapters/AbstractAdapterAuthenticationToken.java index b4b1cce8de..43bc3b9723 100644 --- a/core/src/main/java/org/acegisecurity/adapters/AbstractAdapterAuthenticationToken.java +++ b/core/src/main/java/org/acegisecurity/adapters/AbstractAdapterAuthenticationToken.java @@ -106,13 +106,17 @@ public abstract class AbstractAdapterAuthenticationToken return false; } - public boolean equals(Object obj) { + public boolean equals(Object obj) { if (obj instanceof AbstractAdapterAuthenticationToken) { - if (!super.equals(obj)) - return false; - AbstractAdapterAuthenticationToken test = (AbstractAdapterAuthenticationToken) obj; + if (!super.equals(obj)) { + return false; + } + + AbstractAdapterAuthenticationToken test = (AbstractAdapterAuthenticationToken) obj; + return (this.getKeyHash() == test.getKeyHash()); } + return false; } -} \ No newline at end of file +}