[java-shib-attribute] branch main updated: Javadoc and checkstyle.

Scott Cantor cantor.2 at osu.edu
Thu Apr 17 19:49:51 UTC 2025


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

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

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

The following commit(s) were added to refs/heads/main by this push:
     new aaa15cd21 Javadoc and checkstyle.
aaa15cd21 is described below

commit aaa15cd212ef0aeb8d0e476fb4b2469390f1da86
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Apr 17 15:49:48 2025 -0400

    Javadoc and checkstyle.
---
 .../filter/context/AttributeFilterContext.java     |  8 +++++-
 .../attribute/filter/impl/AttributeFilterImpl.java | 33 ++++++++++++++--------
 2 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/shib-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/context/AttributeFilterContext.java b/shib-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/context/AttributeFilterContext.java
index ee507a4ed..cdeca6ef8 100644
--- a/shib-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/context/AttributeFilterContext.java
+++ b/shib-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/context/AttributeFilterContext.java
@@ -160,7 +160,10 @@ public final class AttributeFilterContext extends BaseContext {
 
     /**
      * Will we include unfiltered attributes in the result?
+     * 
      * @return whether unfilter attributes are to be included
+     * 
+     * @since 5.2.0
      */
     public boolean isIncludeUnfilteredAttributes() {
         return includeUnfilteredAttributes;
@@ -168,9 +171,12 @@ public final class AttributeFilterContext extends BaseContext {
 
     /**
      * Control whether we will include unfiltered attributes in the result.
+     * 
      * @param what if true then we will include unfiltered attributes in the result
+     * 
+     * @since 5.2.0
      */
-    public void setIncludeUnfilteredAttributes(boolean what) {
+    public void setIncludeUnfilteredAttributes(final boolean what) {
         includeUnfilteredAttributes = what;
     }
     
diff --git a/shib-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java b/shib-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java
index 2f716f172..b14de13f3 100644
--- a/shib-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java
+++ b/shib-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java
@@ -91,6 +91,7 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
         return filterPolicies;
     }
 
+// Checkstyle: CyclomaticComplexity OFF
     /**
      * Filters attributes and values. This filtering process may remove attributes and values but must never add them.
      * 
@@ -102,7 +103,6 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
     @Override
     public void filterAttributes(@Nonnull final AttributeFilterContext filterContext) throws AttributeFilterException {
         checkComponentActive();
-
         Constraint.isNotNull(filterContext, "Attribute filter context cannot be null");
         
         final boolean timerStarted = startTimer(filterContext);
@@ -110,7 +110,8 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
             final Map<String, IdPAttribute> prefilteredAttributes = filterContext.getPrefilteredIdPAttributes();
 
             // Create work context to hold intermediate results.
-            final AttributeFilterWorkContext workContext = filterContext.ensureSubcontext(AttributeFilterWorkContext.class);
+            final AttributeFilterWorkContext workContext =
+                    filterContext.ensureSubcontext(AttributeFilterWorkContext.class);
 
             log.debug("{} Beginning process of filtering the following {} attributes: {}", new Object[] {getLogPrefix(),
                     prefilteredAttributes.size(), prefilteredAttributes.keySet(),});
@@ -126,7 +127,8 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
                 log.debug("{} Including unfiltered attributes (if any)", getLogPrefix());
                 for (final Entry<String, IdPAttribute> entry : filterContext.getPrefilteredIdPAttributes().entrySet()) {
                     if (workContext.getFilteredAttributeIds().contains(entry.getKey())) {
-                        log.trace("{} Attribute {} has already been considered for filtering", getLogPrefix(), entry.getKey());
+                        log.trace("{} Attribute {} has already been considered for filtering", getLogPrefix(),
+                                entry.getKey());
                     } else {
                         final List<IdPAttributeValue> values = entry.getValue().getValues();
                         if (values.isEmpty()) {
@@ -169,20 +171,27 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
             }
         }
     }
+// Checkstyle: CyclomaticComplexity ON
 
-    /** Code to replace (null) with <Not Supplied> in the log
+    /**
+     * Code to replace (null) with <Not Supplied> in the log.
+     * 
      * @param input an input String
+     * 
      * @return the input or a fixed string
      */
-    private @Nonnull String notProvidedOr(@Nullable String input) {
+    private @Nonnull String notProvidedOr(@Nullable final String input) {
         return input == null?"<Not Supplied>":input;
     }
 
-    /** Return whether an object is null.
+    /**
+     * Return whether an object is null.
+     * 
      * @param input an input String
+     * 
      * @return {@literal "present"} or {@literal "not present"}
      */
-    private @Nonnull String present(@Nullable Object input) {
+    private @Nonnull String present(@Nullable final Object input) {
         return input != null?"present":"not present";
     }
 
@@ -191,15 +200,17 @@ public class AttributeFilterImpl extends AbstractIdentifiableInitializableCompon
      */
     private void logContext(final @Nonnull AttributeFilterContext filterContext) {
 
-         log.debug("{} Principal {}, IssuerID {}, RecipientID {}, RecipientGroupId {}",
-                logPrefix, notProvidedOr(filterContext.getPrincipal()), notProvidedOr(filterContext.getAttributeIssuerID()),
-                notProvidedOr(filterContext.getAttributeRecipientID()), notProvidedOr(filterContext.getAttributeRecipientGroupID()));
+         log.debug("{} Principal {}, IssuerID {}, RecipientID {}, RecipientGroupId {}", logPrefix,
+                 notProvidedOr(filterContext.getPrincipal()), notProvidedOr(filterContext.getAttributeIssuerID()),
+                 notProvidedOr(filterContext.getAttributeRecipientID()),
+                 notProvidedOr(filterContext.getAttributeRecipientGroupID()));
         log.debug("{} Direction {}", logPrefix, filterContext.getDirection());
         log.debug("{} Issuer MetadataContext {}, Requester MetadataContext {}, Proxied MetadataContext {}", logPrefix,
                 present(filterContext.getIssuerMetadataContext()), present(filterContext.getRequesterMetadataContext()),
                 present(filterContext.getProxiedRequesterMetadataContext()));
         final ProxiedRequesterContext proxiedContext = filterContext.getProxiedRequesterContext();
-        final @Nonnull Collection<String> requesters = proxiedContext != null ? proxiedContext.getRequesters() : CollectionSupport.emptyList();
+        final @Nonnull Collection<String> requesters =
+                proxiedContext != null ? proxiedContext.getRequesters() : CollectionSupport.emptyList();
         if (!requesters.isEmpty()) {
             log.debug("{} Proxy requesters {}", logPrefix, requesters);
         }

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


More information about the commits mailing list