[java-identity-provider] branch main updated: Switch method to Nullable input for Spring friendliness.
Scott Cantor
cantor.2 at osu.edu
Thu Aug 27 19:36:13 UTC 2020
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=5bd32554ee4086ec12a340baaf5c5795bb879f8c
The following commit(s) were added to refs/heads/main by this push:
new 5bd32554e Switch method to Nullable input for Spring friendliness.
5bd32554e is described below
commit 5bd32554ee4086ec12a340baaf5c5795bb879f8c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Aug 27 15:36:04 2020 -0400
Switch method to Nullable input for Spring friendliness.
---
.../idp/authn/AbstractExtractionAction.java | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractExtractionAction.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractExtractionAction.java
index 9aa40812c..ebbcb0508 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractExtractionAction.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractExtractionAction.java
@@ -25,6 +25,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
@@ -73,15 +74,18 @@ public abstract class AbstractExtractionAction extends AbstractAuthenticationAct
*
* @param newTransforms collection of replacement transforms
*/
- public void setTransforms(@Nonnull @NonnullElements final Collection<Pair<String, String>> newTransforms) {
+ public void setTransforms(@Nullable @NonnullElements final Collection<Pair<String, String>> newTransforms) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- Constraint.isNotNull(newTransforms, "Transforms collection cannot be null");
-
- transforms = new ArrayList<>();
- for (final Pair<String,String> p : newTransforms) {
- final Pattern pattern = Pattern.compile(StringSupport.trimOrNull(p.getFirst()));
- transforms.add(new Pair<>(pattern, Constraint.isNotNull(
- StringSupport.trimOrNull(p.getSecond()), "Replacement expression cannot be null")));
+
+ if (newTransforms != null) {
+ transforms = new ArrayList<>();
+ for (final Pair<String,String> p : newTransforms) {
+ final Pattern pattern = Pattern.compile(StringSupport.trimOrNull(p.getFirst()));
+ transforms.add(new Pair<>(pattern, Constraint.isNotNull(
+ StringSupport.trimOrNull(p.getSecond()), "Replacement expression cannot be null")));
+ }
+ } else {
+ transforms = Collections.emptyList();
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list