[java-identity-provider COMMIT] /trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyId...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Feb 28 20:48:44 EST 2014
Author: scantor
Date: Fri Feb 28 20:48:44 2014
New Revision: 5495
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5495&view=rev
Log:
Add trimming of parameters.
Modified:
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java
Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java?rev=5495&r1=5494&r2=5495&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java Fri Feb 28 20:48:44 2014
@@ -29,14 +29,13 @@
import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializeableComponent;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.opensaml.profile.context.ProfileRequestContext;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
import com.google.common.collect.Sets;
/**
@@ -54,7 +53,6 @@
/** Constructor. */
public RelyingPartyIdPredicate() {
- super.setId(getClass().getName());
relyingPartyContextLookupStrategy = new ChildContextLookup<>(RelyingPartyContext.class);
relyingPartyIds = Collections.emptySet();
}
@@ -80,8 +78,14 @@
public synchronized void setRelyingPartyIds(@Nonnull @NonnullElements final Collection<String> ids) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
Constraint.isNotNull(ids, "Relying party ID collection cannot be null");
-
- relyingPartyIds = Sets.newHashSet(Collections2.filter(ids, Predicates.notNull()));
+
+ relyingPartyIds = Sets.newHashSet();
+ for (final String id : ids) {
+ final String trimmed = StringSupport.trimOrNull(id);
+ if (trimmed != null) {
+ relyingPartyIds.add(trimmed);
+ }
+ }
}
/** {@inheritDoc} */
More information about the commits
mailing list