[java-metadata-aggregator] 02/03: Repharase a null check

Ian Young ian at iay.org.uk
Sat Oct 22 15:29:17 UTC 2022


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=58ab183fcb154fd6e0c95fc8da2229d921856ccd

commit 58ab183fcb154fd6e0c95fc8da2229d921856ccd
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Sat Oct 22 15:14:29 2022 +0100

    Repharase a null check
---
 .../shibboleth/metadata/dom/AbstractAttributeValidationStage.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mda-framework/src/main/java/net/shibboleth/metadata/dom/AbstractAttributeValidationStage.java b/mda-framework/src/main/java/net/shibboleth/metadata/dom/AbstractAttributeValidationStage.java
index d9e4af3..a24bf05 100644
--- a/mda-framework/src/main/java/net/shibboleth/metadata/dom/AbstractAttributeValidationStage.java
+++ b/mda-framework/src/main/java/net/shibboleth/metadata/dom/AbstractAttributeValidationStage.java
@@ -131,9 +131,12 @@ public abstract class AbstractAttributeValidationStage<T> extends AbstractElemen
     protected void visit(@Nonnull final Element element, @Nonnull final DOMTraversalContext context)
             throws StageProcessingException {
         
-        // Look at the attributes. If there are none, we're done.
+        // Look at the attributes.
         final var attributes = element.getAttributes();
-        if (attributes == null) return;
+        
+        // This is always non-null for an {@link Element}; it can only be
+        // null for other node types.
+        assert attributes != null;
 
         // Iterate through the attributes on this element.
         for (int i = 0; i < attributes.getLength(); i++) {

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


More information about the commits mailing list