[java-metadata-aggregator] branch main updated: Nullability

Ian Young ian at iay.org.uk
Mon Apr 3 21:58:45 UTC 2023


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

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

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

The following commit(s) were added to refs/heads/main by this push:
     new efc0fab  Nullability
efc0fab is described below

commit efc0fab33e00e11b9928ba594c5ebe21b86573aa
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Mon Apr 3 22:58:39 2023 +0100

    Nullability
---
 .../metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java   | 1 +
 .../net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java    | 9 +++++----
 .../metadata/pipeline/FilesInDirectoryMultiOutputStrategy.java   | 2 +-
 .../test/java/net/shibboleth/metadata/dom/ElementMakerTest.java  | 1 +
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java b/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
index a23079b..b1b89fa 100644
--- a/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
+++ b/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/EntitiesDescriptorDisassemblerStage.java
@@ -77,6 +77,7 @@ public class EntitiesDescriptorDisassemblerStage extends AbstractStage<Element>
 
         final List<Element> children = ElementSupport.getChildElements(entitiesDescriptor);
         for (final Element child : children) {
+            assert child != null;
             if (SAMLMetadataSupport.isEntitiesDescriptor(child)) {
                 processEntitiesDescriptor(items, child);
             }
diff --git a/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java b/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
index 9584803..b8f0e53 100644
--- a/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
+++ b/mda-framework/src/main/java/net/shibboleth/metadata/dom/saml/SAMLMetadataSupport.java
@@ -119,7 +119,8 @@ public final class SAMLMetadataSupport {
      *
      * @since 0.10.0
      */
-    public static final @Nonnull QName ORGANIZATIONDISPLAYNAME_NAME = new QName(MD_NS, "OrganizationDisplayName", MD_PREFIX);
+    public static final @Nonnull QName ORGANIZATIONDISPLAYNAME_NAME =
+            new QName(MD_NS, "OrganizationDisplayName", MD_PREFIX);
 
     /**
      * QName of the OrganizationURL element.
@@ -140,7 +141,7 @@ public final class SAMLMetadataSupport {
      * 
      * @return true if the element is an EntityDescriptor or EntitiesDescriptor
      */
-    public static boolean isEntityOrEntitiesDescriptor(@Nullable final Element e) {
+    public static boolean isEntityOrEntitiesDescriptor(@Nonnull final Element e) {
         return isEntitiesDescriptor(e) || isEntityDescriptor(e);
     }
 
@@ -151,7 +152,7 @@ public final class SAMLMetadataSupport {
      * 
      * @return true if the element is an EntitiesDescriptor, false otherwise
      */
-    public static boolean isEntitiesDescriptor(@Nullable final Element e) {
+    public static boolean isEntitiesDescriptor(@Nonnull final Element e) {
         return ElementSupport.isElementNamed(e, ENTITIES_DESCRIPTOR_NAME);
     }
 
@@ -162,7 +163,7 @@ public final class SAMLMetadataSupport {
      * 
      * @return true if the element is an EntityDescriptor, false otherwise
      */
-    public static boolean isEntityDescriptor(@Nullable final Element e) {
+    public static boolean isEntityDescriptor(@Nonnull final Element e) {
         return ElementSupport.isElementNamed(e, ENTITY_DESCRIPTOR_NAME);
     }
 
diff --git a/mda-framework/src/main/java/net/shibboleth/metadata/pipeline/FilesInDirectoryMultiOutputStrategy.java b/mda-framework/src/main/java/net/shibboleth/metadata/pipeline/FilesInDirectoryMultiOutputStrategy.java
index 0065fe9..3852f3f 100644
--- a/mda-framework/src/main/java/net/shibboleth/metadata/pipeline/FilesInDirectoryMultiOutputStrategy.java
+++ b/mda-framework/src/main/java/net/shibboleth/metadata/pipeline/FilesInDirectoryMultiOutputStrategy.java
@@ -86,7 +86,7 @@ public class FilesInDirectoryMultiOutputStrategy<T> extends AbstractInitializabl
         }
 
         @Override
-        public OutputStream getOutputStream() throws IOException {
+        public @Nonnull OutputStream getOutputStream() throws IOException {
             return new FileOutputStream(file);
         }
         
diff --git a/mda-framework/src/test/java/net/shibboleth/metadata/dom/ElementMakerTest.java b/mda-framework/src/test/java/net/shibboleth/metadata/dom/ElementMakerTest.java
index 7a82c73..3792a7b 100644
--- a/mda-framework/src/test/java/net/shibboleth/metadata/dom/ElementMakerTest.java
+++ b/mda-framework/src/test/java/net/shibboleth/metadata/dom/ElementMakerTest.java
@@ -24,6 +24,7 @@ public class ElementMakerTest extends BaseDOMTest {
     public void apply() {
         final Function<Container, Element> maker = new ElementMaker(new QName("ns", "local"));
         final Element root = doc.createElementNS("ns", "root");
+        assert root != null;
         final Container rootContainer = new Container(root);
         final Element newElement = maker.apply(rootContainer);
         Assert.assertNotNull(newElement);

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


More information about the commits mailing list