[java-metadata-aggregator] 02/04: Clarify through annotations that item metadata has no null elements

Ian Young ian at iay.org.uk
Thu Jul 9 14:51:33 UTC 2020


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

iay pushed a commit to branch master
in repository java-metadata-aggregator.

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

commit eb526f5e3b2579769acc972d937c310e50050574
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Thu Jul 9 13:40:03 2020 +0100

    Clarify through annotations that item metadata has no null elements
---
 .../src/main/java/net/shibboleth/metadata/AbstractItem.java          | 5 +++--
 aggregator-pipeline/src/main/java/net/shibboleth/metadata/Item.java  | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/AbstractItem.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/AbstractItem.java
index 5fddd97..bbdc973 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/AbstractItem.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/AbstractItem.java
@@ -21,6 +21,7 @@ import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.annotation.concurrent.ThreadSafe;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.collection.ClassToInstanceMultiMap;
 
 /**
@@ -56,8 +57,8 @@ public abstract class AbstractItem<T> implements Item<T> {
         data = newData;
     }
 
-    /** {@inheritDoc} */
-    @Override @Nonnull public ClassToInstanceMultiMap<ItemMetadata> getItemMetadata() {
+    @Override
+    @Nonnull @NonnullElements public ClassToInstanceMultiMap<ItemMetadata> getItemMetadata() {
         return metadata;
     }
 }
\ No newline at end of file
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Item.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Item.java
index 5f119d8..f1e8df5 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Item.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/Item.java
@@ -20,6 +20,7 @@ package net.shibboleth.metadata;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.collection.ClassToInstanceMultiMap;
 
 /**
@@ -41,7 +42,7 @@ public interface Item<T> {
      * 
      * @return metadata attached to this Item
      */
-    @Nonnull ClassToInstanceMultiMap<ItemMetadata> getItemMetadata();
+    @Nonnull @NonnullElements ClassToInstanceMultiMap<ItemMetadata> getItemMetadata();
 
     /**
      * Performs a copy of this Item. All member fields, except {@link ItemMetadata}, should be deep cloned.

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


More information about the commits mailing list