[java-identity-provider] branch master updated: IDP-1518 Add failure case for impossible empty attribute value

Rod Widdowson rdw at steadingsoftware.com
Thu Nov 7 05:05:38 EST 2019


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

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=1ab03a2ee1137ddb84134b5fa42c26eaf86070f4

The following commit(s) were added to refs/heads/master by this push:
       new  1ab03a2   IDP-1518 Add failure case for impossible empty attribute value
1ab03a2 is described below

commit 1ab03a2ee1137ddb84134b5fa42c26eaf86070f4
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Nov 7 10:03:48 2019 +0000

    IDP-1518 Add failure case for impossible empty attribute value
    
    https://issues.shibboleth.net/jira/browse/IDP-1518
---
 .../main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java   | 2 +-
 .../idp/consent/logic/impl/AttributeValuesHashFunction.java           | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
index 14125db..01671b7 100644
--- a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
+++ b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
  * An {@link IdPAttributeValue} that is empty. This class defines an enum to represent the various types of empty values
  * that can occur.
  */
-public class EmptyAttributeValue implements IdPAttributeValue {
+public final class EmptyAttributeValue implements IdPAttributeValue {
 
     /** Instance of null empty attribute value. */
     public static final EmptyAttributeValue NULL = new EmptyAttributeValue(EmptyType.NULL_VALUE);
diff --git a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
index 7c8e870..61e2f07 100644
--- a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
+++ b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
@@ -98,8 +98,10 @@ public class AttributeValuesHashFunction implements Function<Collection<IdPAttri
                     objectOutputStream.writeObject(Long.valueOf(42));
                     if (EmptyAttributeValue.NULL.getValue().equals(value.getNativeValue())) {
                         objectOutputStream.writeObject("NULLVALUE");
-                    } else {
+                    } else if (EmptyAttributeValue.ZERO_LENGTH.getValue().equals(value.getNativeValue())) {
                         objectOutputStream.writeObject("EMPTY VALUE");
+                    } else {
+                        log.error("Internal error - impossible null attribute");
                     }
                 } else if (value.getNativeValue() != null) {
                     objectOutputStream.writeObject(value.getNativeValue());

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


More information about the commits mailing list