[java-shib-attribute] 01/03: JSATTR-44 IdPAttribute.hashCode() take the has over the values and id, whereas IdPAttribute.equals only looks at the id

Rod Widdowson rdw at steadingsoftware.com
Tue Apr 22 09:21:15 UTC 2025


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=ce453cd96cc8f84345c2c0ff71b0ba2fd5a22a7d

commit ce453cd96cc8f84345c2c0ff71b0ba2fd5a22a7d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Apr 21 15:27:14 2025 +0100

    JSATTR-44 IdPAttribute.hashCode() take the has over the values and id, whereas IdPAttribute.equals only looks at the id
    
    https://shibboleth.atlassian.net/browse/JSATTR-44
    
    Add clarifying comment to the equals method explaining why a non-intuitive implementation
    is being used.
---
 .../src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
index dd2255264..8fe83919e 100644
--- a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
+++ b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
@@ -183,7 +183,11 @@ public class IdPAttribute implements Comparable<IdPAttribute>, Cloneable {
         return Objects.hashCode(id);
     }
 
-    /** {@inheritDoc} */
+    /** {@inheritDoc}
+     *
+     * Note that for historic reasons IdPAttribute equality is based only on the Identifier (the values are no looked at)
+     * See JSATTR-45 for why.
+     */
     @Override
     public boolean equals(final Object obj) {
         if (this == obj) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list