[java-support] branch master updated: IDP-1047 Add annotation to helper class constructor's parameter.

Rod Widdowson rdw at steadingsoftware.com
Tue Oct 4 08:59:31 EDT 2016


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

rdw pushed a commit to branch master
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=40bb5f17d45e68418ca40231b016c50071a0a51c

The following commit(s) were added to refs/heads/master by this push:
       new  40bb5f1   IDP-1047 Add annotation to helper class constructor's parameter.
40bb5f1 is described below

commit 40bb5f17d45e68418ca40231b016c50071a0a51c
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Oct 4 13:48:43 2016 +0100

    IDP-1047 Add annotation to helper class constructor's parameter.
    
    https://issues.shibboleth.net/jira/browse/IDP-1047
    
    This one used found lurking in the custom parsers.
---
 .../utilities/java/support/codec/StringDigester.java          | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/codec/StringDigester.java b/src/main/java/net/shibboleth/utilities/java/support/codec/StringDigester.java
index d5d3c04..8acea92 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/codec/StringDigester.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/codec/StringDigester.java
@@ -24,6 +24,7 @@ import java.security.NoSuchAlgorithmException;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import net.shibboleth.utilities.java.support.annotation.ParameterName;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -82,7 +83,8 @@ public class StringDigester implements Function<String, String> {
      * @param format the output format used to convert the digested[] to the output string
      * @throws NoSuchAlgorithmException thrown if the digestAlgorithm is not invalid or unsupported
      */
-    public StringDigester(@Nonnull @NotEmpty final String algorithm, @Nonnull final OutputFormat format) 
+    public StringDigester(@Nonnull @NotEmpty @ParameterName(name="algorithm") final String algorithm, 
+            @Nonnull  @ParameterName(name="format") final OutputFormat format) 
             throws NoSuchAlgorithmException {
        this(algorithm, format, DEFAULT_INPUT_CHARSET); 
     }
@@ -95,8 +97,9 @@ public class StringDigester implements Function<String, String> {
      * @param charset the character set to use in converting the input string to a byte[] prior to digesting
      * @throws NoSuchAlgorithmException thrown if the digestAlgorithm is not invalid or unsupported
      */
-    public StringDigester(@Nonnull @NotEmpty final String algorithm, @Nonnull final OutputFormat format, 
-            @Nullable final Charset charset) throws NoSuchAlgorithmException {
+    public StringDigester(@Nonnull @NotEmpty @ParameterName(name="algorithm") final String algorithm, 
+            @Nonnull @ParameterName(name="format") final OutputFormat format, 
+            @Nullable @ParameterName(name="charset") final Charset charset) throws NoSuchAlgorithmException {
         
         digestAlgorithm = Constraint.isNotNull(StringSupport.trimOrNull(algorithm), 
                 "Digest algorithm was null or empty");
@@ -137,7 +140,7 @@ public class StringDigester implements Function<String, String> {
     }
 
     /** {@inheritDoc} */
-    @Nullable public String apply(@Nullable final String input) {
+    @Override @Nullable public String apply(@Nullable final String input) {
         String trimmed = StringSupport.trimOrNull(input);
         if (trimmed == null) {
             log.debug("Trimmed input was null, returning null");

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


More information about the commits mailing list