[java-identity-provider] 21/51: Missing annotations.

Rod Widdowson rdw at steadingsoftware.com
Sat Mar 16 14:28:53 UTC 2024


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

rdw pushed a commit to branch dev/IDP-2147
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=54a7c97715810aaa2f61749f19bbd6b71d94078d

commit 54a7c97715810aaa2f61749f19bbd6b71d94078d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Feb 19 08:34:24 2024 -0500

    Missing annotations.
---
 .../shibboleth/idp/ui/helper/AttributeHelper.java  | 30 ++++++++--------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/idp-ui/src/main/java/net/shibboleth/idp/ui/helper/AttributeHelper.java b/idp-ui/src/main/java/net/shibboleth/idp/ui/helper/AttributeHelper.java
index a6f67c144..350df33be 100644
--- a/idp-ui/src/main/java/net/shibboleth/idp/ui/helper/AttributeHelper.java
+++ b/idp-ui/src/main/java/net/shibboleth/idp/ui/helper/AttributeHelper.java
@@ -56,12 +56,8 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * @param attributeName The attribute name to look up
      * @return The attribute value or null
      */
-    @Nullable public IdPAttributeValue getFirstAttributeValue(final ProfileRequestContext prc,
-           final @Nonnull @NotEmpty String attributeName) {
-        if (prc == null) {
-            log.error("Provided ProfileRequestContext was null");
-            return null;
-        }
+    @Nullable public IdPAttributeValue getFirstAttributeValue(@Nonnull final ProfileRequestContext prc,
+           @Nonnull @NotEmpty final String attributeName) {
         Constraint.isNotNull(attributeName, "Attribute Name must be non-niull");
         final AttributeContext context = attributeContextStrategy.apply(prc);
         if (context == null) {
@@ -77,8 +73,8 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * @param defaultValue What to return if nothing found.
      * @return The default value or the attribute value
      */
-    @Nonnull public String getFirstAttributeDisplayValue(final ProfileRequestContext prc,
-                final @Nonnull @NotEmpty String attributeName,
+    @Nonnull public String getFirstAttributeDisplayValue(@Nonnull final ProfileRequestContext prc,
+                @Nonnull @NotEmpty final String attributeName,
             final @Nonnull  String defaultValue) {
         Constraint.isNotNull(defaultValue, "Default value must be non-null");
         final IdPAttributeValue value = getFirstAttributeValue(prc, attributeName);
@@ -94,8 +90,8 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * @param attributeName The attribute name to look up
      * @return The attribute value or ""
      */
-    @Nonnull public String getFirstAttributeDisplayValue(final ProfileRequestContext prc,
-                final @Nonnull @NotEmpty String attributeName) {
+    @Nonnull public String getFirstAttributeDisplayValue(@Nonnull final ProfileRequestContext prc,
+                @Nonnull @NotEmpty final String attributeName) {
         return getFirstAttributeDisplayValue(prc, attributeName, "");
     }
 
@@ -104,13 +100,9 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * @param attributeName The attribute name to look up
      * @return The attribute value or null
      */
-    @Nullable public IdPAttributeValue getFirstUnfilteredAttributeValue(final ProfileRequestContext prc,
-                         final @Nonnull @NotEmpty String attributeName) {
+    @Nullable public IdPAttributeValue getFirstUnfilteredAttributeValue(@Nonnull final ProfileRequestContext prc,
+                         @Nonnull @NotEmpty final String attributeName) {
 
-        if (prc == null) {
-            log.error("Provided ProfileRequestContext was null");
-            return null;
-        }
         Constraint.isNotNull(attributeName, "Attribute Name must be non-niull");
         final AttributeContext context = attributeContextStrategy.apply(prc);
         if (context == null) {
@@ -130,8 +122,8 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * 
      * @return The default value or the attribute value
      */
-    @Nonnull public String getFirstUnfilteredAttributeDisplayValue(final ProfileRequestContext prc,
-                         final @Nonnull @NotEmpty String attributeName,
+    @Nonnull public String getFirstUnfilteredAttributeDisplayValue(@Nonnull final ProfileRequestContext prc,
+                         @Nonnull @NotEmpty final String attributeName,
              final @Nonnull String defaultValue) {
 
         Constraint.isNotNull(defaultValue, "Default value must be non-null");
@@ -148,7 +140,7 @@ public final class AttributeHelper extends AbstractIdentifiableInitializableComp
      * @param attributeName The attribute name to look up
      * @return The attribute value or ""
      */
-    @Nonnull public String getFirstUnfilteredAttributeDisplayValue(final ProfileRequestContext prc,
+    @Nonnull public String getFirstUnfilteredAttributeDisplayValue(@Nonnull final ProfileRequestContext prc,
             @Nonnull @NotEmpty final String attributeName) {
         return getFirstUnfilteredAttributeDisplayValue(prc, attributeName, "");
     }

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


More information about the commits mailing list