[java-shib-attribute] branch main updated: Null cleanup.

Codeberg noreply at shibboleth.net
Tue Nov 25 15:37:12 UTC 2025


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

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

View the commit online:
https://codeberg.org/Shibboleth/java-shib-attribute/commit/dda616aa242acdf7afe472884089e34b87c1fe78

The following commit(s) were added to refs/heads/main by this push:
     new dda616aa2 Null cleanup.
dda616aa2 is described below

commit dda616aa242acdf7afe472884089e34b87c1fe78
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Nov 25 10:36:21 2025 -0500

    Null cleanup.
---
 .../resolver/dc/http/impl/ScriptedResponseMappingStrategy.java      | 2 +-
 .../attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java  | 2 +-
 .../resolver/dc/storage/impl/ScriptedStorageMappingStrategy.java    | 2 +-
 .../idp/attribute/resolver/impl/AttributeResolverImplTest.java      | 6 +++++-
 .../idp/attribute/resolver/testing/ResolverTestSupport.java         | 2 +-
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/ScriptedResponseMappingStrategy.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/ScriptedResponseMappingStrategy.java
index 591efda59..4a2281355 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/ScriptedResponseMappingStrategy.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/ScriptedResponseMappingStrategy.java
@@ -191,7 +191,7 @@ public final class ScriptedResponseMappingStrategy extends AbstractScriptEvaluat
                 outputMap.put(attribute.getId(), attribute);
             } else {
                 log.warn("{} Output collection contained an object of type '{}', ignored", getLogPrefix(),
-                        o.getClass().getName());
+                        o != null ? o.getClass().getName() : null);
             }
         }
 
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
index 2afb90f15..de0556f4a 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/scripted/impl/ScriptedDataConnector.java
@@ -274,7 +274,7 @@ public class ScriptedDataConnector extends AbstractSearchDataConnector<ScriptedS
                     outputMap.put(attribute.getId(), attribute);
                 } else {
                     log.warn("{} Output collection contained an object of type '{}', ignored", getLogPrefix(),
-                            o.getClass().getName());
+                            o != null ? o.getClass().getName() : null);
                 }
             }
 
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/storage/impl/ScriptedStorageMappingStrategy.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/storage/impl/ScriptedStorageMappingStrategy.java
index 5675b889d..daaf71806 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/storage/impl/ScriptedStorageMappingStrategy.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/storage/impl/ScriptedStorageMappingStrategy.java
@@ -126,7 +126,7 @@ public final class ScriptedStorageMappingStrategy extends AbstractScriptEvaluato
                 outputMap.put(attribute.getId(), attribute);
             } else {
                 log.warn("{} Output collection contained an object of type '{}', ignored", getLogPrefix(),
-                        o.getClass().getName());
+                        o != null ? o.getClass().getName() : null);
             }
         }
 
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
index 60b3d05cc..a1aa6f847 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
@@ -784,7 +784,11 @@ public class AttributeResolverImplTest {
      */
     @Test public void resolveNullValues() throws Exception {
         final IdPAttribute attribute = new IdPAttribute("ad1");
-        attribute.setValues(Arrays.asList(new EmptyAttributeValue(EmptyType.NULL_VALUE), new EmptyAttributeValue(EmptyType.ZERO_LENGTH_VALUE), null));
+        final List<IdPAttributeValue> vals = new ArrayList<>(3);
+        vals.add(new EmptyAttributeValue(EmptyType.NULL_VALUE));
+        vals.add(new EmptyAttributeValue(EmptyType.ZERO_LENGTH_VALUE));
+        vals.add(null);
+        attribute.setValues(vals);
 
         final MockAttributeDefinition definition = new MockAttributeDefinition("ad1", attribute);
 
diff --git a/shib-attribute-testing/src/main/java/net/shibboleth/idp/attribute/resolver/testing/ResolverTestSupport.java b/shib-attribute-testing/src/main/java/net/shibboleth/idp/attribute/resolver/testing/ResolverTestSupport.java
index caaeb3fc0..361beaad8 100644
--- a/shib-attribute-testing/src/main/java/net/shibboleth/idp/attribute/resolver/testing/ResolverTestSupport.java
+++ b/shib-attribute-testing/src/main/java/net/shibboleth/idp/attribute/resolver/testing/ResolverTestSupport.java
@@ -100,7 +100,7 @@ public class ResolverTestSupport {
      * @param values its values (as strings)
      * @return the Attribute
      */
-    @Nonnull public static IdPAttribute buildAttribute(@Nonnull @NotEmpty final String attributeId, @Nonnull final String... values) {
+    @Nonnull public static IdPAttribute buildAttribute(@Nonnull @NotEmpty final String attributeId, final String... values) {
         final IdPAttribute attribute = new IdPAttribute(attributeId);
         
         List<IdPAttributeValue> valueList = new ArrayList<>();

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


More information about the commits mailing list