[java-shib-metadata] branch main updated: IDP-2069 - Null Handling Task

Scott Cantor cantor.2 at osu.edu
Mon Mar 27 17:44:32 UTC 2023


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

scantor pushed a commit to branch main
in repository java-shib-metadata.

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

The following commit(s) were added to refs/heads/main by this push:
     new ed963484 IDP-2069 - Null Handling Task
ed963484 is described below

commit ed963484dfe1e248341e2946573447eb2edc6786
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Mar 27 13:44:29 2023 -0400

    IDP-2069 - Null Handling Task
    
    Annotation cleanup.
---
 .../java/net/shibboleth/idp/saml/metadata/IdPUIInfo.java    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/shib-metadata-api/src/main/java/net/shibboleth/idp/saml/metadata/IdPUIInfo.java b/shib-metadata-api/src/main/java/net/shibboleth/idp/saml/metadata/IdPUIInfo.java
index f43fae50..7a8440e8 100644
--- a/shib-metadata-api/src/main/java/net/shibboleth/idp/saml/metadata/IdPUIInfo.java
+++ b/shib-metadata-api/src/main/java/net/shibboleth/idp/saml/metadata/IdPUIInfo.java
@@ -18,7 +18,6 @@
 package net.shibboleth.idp.saml.metadata;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -27,6 +26,7 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.opensaml.saml.ext.saml2mdui.Keywords;
 import org.opensaml.saml.ext.saml2mdui.Logo;
@@ -70,10 +70,9 @@ public class IdPUIInfo {
  
     /** Warning check against a non localized keyword. */
     private final Predicate<Keywords> nullLanguageKeyword = new Predicate<>() {
-        public boolean test(final Keywords u) {
-            if (u.getXMLLang() == null) {
-                LOG.warn("Keyword with value {} in <IdpUIInfo/> has no language associated, ignoring",
-                        u.getKeywords().toString());
+        public boolean test(@Nullable final Keywords u) {
+            if (u != null && u.getXMLLang() == null) {
+                LOG.warn("Keyword with value {} in <IdpUIInfo/> has no language associated, ignoring", u.getKeywords());
                 return false;
             }
             return true;
@@ -152,8 +151,8 @@ public class IdPUIInfo {
                 noLocaleLogo.add(logo);
             }
         }
-        localeLogos = Collections.unmodifiableMap(withLocaleLogo);
-        nonLocaleLogos = Collections.unmodifiableList(noLocaleLogo);
+        localeLogos = CollectionSupport.copyToMap(withLocaleLogo);
+        nonLocaleLogos = CollectionSupport.copyToList(noLocaleLogo);
     }
     
     /** Warning check against a non localized String.

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


More information about the commits mailing list