[java-identity-provider] branch master updated: Clean up a couple of additional list properties.
Scott Cantor
cantor.2 at osu.edu
Fri Nov 1 12:45:51 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=67d1b21f599c3c04f99df8aeac2154e324fcd941
The following commit(s) were added to refs/heads/master by this push:
new 67d1b21 Clean up a couple of additional list properties.
67d1b21 is described below
commit 67d1b21f599c3c04f99df8aeac2154e324fcd941
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Nov 1 12:45:48 2019 -0400
Clean up a couple of additional list properties.
---
.../profile/config/AbstractProfileConfiguration.java | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
index 43d39f6..25493b2 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
@@ -17,8 +17,8 @@
package net.shibboleth.idp.profile.config;
-import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
@@ -31,7 +31,6 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElemen
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
-import net.shibboleth.utilities.java.support.collection.CollectionSupport;
import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.logic.FunctionSupport;
@@ -105,7 +104,11 @@ public abstract class AbstractProfileConfiguration extends AbstractIdentifiableI
/** {@inheritDoc} */
@Nonnull @NonnullElements @NotLive @Unmodifiable public List<String> getInboundInterceptorFlows(
@Nullable final ProfileRequestContext profileRequestContext) {
- return CollectionSupport.buildImmutableList(inboundFlowsLookupStrategy.apply(profileRequestContext));
+ final List<String> flows = inboundFlowsLookupStrategy.apply(profileRequestContext);
+ if (flows != null) {
+ return List.copyOf(flows);
+ }
+ return Collections.emptyList();
}
/**
@@ -116,7 +119,7 @@ public abstract class AbstractProfileConfiguration extends AbstractIdentifiableI
public void setInboundInterceptorFlows(@Nullable @NonnullElements final Collection<String> flows) {
if (flows != null) {
inboundFlowsLookupStrategy =
- FunctionSupport.constant(new ArrayList<>(StringSupport.normalizeStringCollection(flows)));
+ FunctionSupport.constant(List.copyOf(StringSupport.normalizeStringCollection(flows)));
} else {
inboundFlowsLookupStrategy = FunctionSupport.constant(null);
}
@@ -137,7 +140,11 @@ public abstract class AbstractProfileConfiguration extends AbstractIdentifiableI
/** {@inheritDoc} */
@Nonnull @NonnullElements @NotLive @Unmodifiable public List<String> getOutboundInterceptorFlows(
@Nullable final ProfileRequestContext profileRequestContext) {
- return CollectionSupport.buildImmutableList(outboundFlowsLookupStrategy.apply(profileRequestContext));
+ final List<String> flows = outboundFlowsLookupStrategy.apply(profileRequestContext);
+ if (flows != null) {
+ return List.copyOf(flows);
+ }
+ return Collections.emptyList();
}
/**
@@ -148,7 +155,7 @@ public abstract class AbstractProfileConfiguration extends AbstractIdentifiableI
public void setOutboundInterceptorFlows(@Nullable @NonnullElements final Collection<String> flows) {
if (flows != null) {
outboundFlowsLookupStrategy =
- FunctionSupport.constant(new ArrayList<>(StringSupport.normalizeStringCollection(flows)));
+ FunctionSupport.constant(List.copyOf(StringSupport.normalizeStringCollection(flows)));
} else {
outboundFlowsLookupStrategy = FunctionSupport.constant(null);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list