[java-opensaml] branch main updated: Adjust handling of keyword values and make non-live.

Scott Cantor cantor.2 at osu.edu
Wed Apr 5 19:39:45 UTC 2023


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=054d2375b21bbf0358c59f694332d2554a678f4e

The following commit(s) were added to refs/heads/main by this push:
     new 054d2375b Adjust handling of keyword values and make non-live.
054d2375b is described below

commit 054d2375b21bbf0358c59f694332d2554a678f4e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 5 15:39:40 2023 -0400

    Adjust handling of keyword values and make non-live.
---
 .../main/java/org/opensaml/saml/ext/saml2mdui/Keywords.java    |  6 ++++--
 .../org/opensaml/saml/ext/saml2mdui/impl/KeywordsImpl.java     | 10 +++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdui/Keywords.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdui/Keywords.java
index c6461c3f0..f102a21b1 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdui/Keywords.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdui/Keywords.java
@@ -28,6 +28,8 @@ import org.opensaml.saml.common.SAMLObject;
 import org.opensaml.saml.common.xml.SAMLConstants;
 
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.annotation.constraint.NotLive;
+import net.shibboleth.shared.annotation.constraint.Unmodifiable;
 
 /**
  * DisplayName.
@@ -60,7 +62,7 @@ public interface Keywords extends SAMLObject, LangBearing  {
      * 
      * @return the keywords
      */
-    @Nullable List<String> getKeywords();
+    @Nullable @NotLive @Unmodifiable List<String> getKeywords();
     
     /**
      * Sets the keywords.
@@ -69,4 +71,4 @@ public interface Keywords extends SAMLObject, LangBearing  {
      */
     void setKeywords(@Nullable final List<String> val);
    
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsImpl.java
index e8606ada9..21651d0e0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsImpl.java
@@ -29,9 +29,9 @@ import org.opensaml.saml.ext.saml2mdui.Keywords;
 
 import com.google.common.base.Strings;
 
-import net.shibboleth.shared.annotation.constraint.Live;
 import net.shibboleth.shared.annotation.constraint.NotLive;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
 
 /**
  * Concrete implementation of {@link Keywords}.
@@ -69,13 +69,17 @@ public class KeywordsImpl extends AbstractXMLObject implements Keywords {
     }
 
     /** {@inheritDoc} */
-    @Nullable @Live public List<String> getKeywords() {
+    @Nullable @NotLive @Unmodifiable public List<String> getKeywords() {
         return data;
     }
 
     /** {@inheritDoc} */
     public void setKeywords(@Nullable final List<String> val) {
-        data = prepareForAssignment(data, val);
+        if (val != null) {
+            data = prepareForAssignment(data, CollectionSupport.copyToList(val));
+        } else {
+            data = prepareForAssignment(data, null);
+        }
     }
 
     /**

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


More information about the commits mailing list