[java-identity-provider COMMIT] in /trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl: ExtractRemoteUs...

noreply at shibboleth.net noreply at shibboleth.net
Wed May 28 12:46:24 EDT 2014


Author: scantor
Date: Wed May 28 12:46:24 2014
New Revision: 5983

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5983&view=rev
Log:
Collection cleanup

Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java?rev=5983&r1=5982&r2=5983&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java Wed May 28 12:46:24 2014
@@ -30,14 +30,13 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 
 /**
@@ -90,7 +89,7 @@
     public void setCheckAttributes(@Nonnull @NonnullElements final Collection<String> attributes) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        checkAttributes = Lists.newArrayList(Collections2.filter(attributes, Predicates.notNull()));
+        checkAttributes = Lists.newArrayList(StringSupport.normalizeStringCollection(attributes));
     }
 
     /**
@@ -101,7 +100,7 @@
     public void setCheckHeaders(@Nonnull @NonnullElements final Collection<String> headers) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        checkHeaders = Lists.newArrayList(Collections2.filter(headers, Predicates.notNull()));
+        checkHeaders = Lists.newArrayList(StringSupport.normalizeStringCollection(headers));
     }
     
     /** {@inheritDoc} */

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java?rev=5983&r1=5982&r2=5983&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java Wed May 28 12:46:24 2014
@@ -34,6 +34,7 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.action.EventIds;
@@ -41,8 +42,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
 import com.google.common.collect.Sets;
 
 /**
@@ -63,9 +62,6 @@
 
     /** Class logger. */
     @Nonnull private final Logger log = LoggerFactory.getLogger(ValidateRemoteUser.class);
-
-    /** Username context identifying identity to validate. */
-    @Nullable private UsernameContext usernameContext;
     
     /** A whitelist of usernames to accept. */
     @Nonnull @NonnullElements private Set<String> whitelistedUsernames;
@@ -75,11 +71,12 @@
 
     /** A regular expression to apply for acceptance testing. */
     @Nullable private Pattern matchExpression;
+
+    /** Username context identifying identity to validate. */
+    @Nullable private UsernameContext usernameContext;
     
     /** Constructor. */
     public ValidateRemoteUser() {
-        super();
-        
         whitelistedUsernames = Collections.emptySet();
         blacklistedUsernames = Collections.emptySet();
     }
@@ -92,7 +89,7 @@
     public void setWhitelistedUsernames(@Nonnull @NonnullElements final Collection<String> whitelist) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        whitelistedUsernames = Sets.newHashSet(Collections2.filter(whitelist, Predicates.notNull()));
+        whitelistedUsernames = Sets.newHashSet(StringSupport.normalizeStringCollection(whitelist));
     }
 
     /**
@@ -103,7 +100,7 @@
     public void setBlacklistedUsernames(@Nonnull @NonnullElements final Collection<String> blacklist) {

[... 17 lines stripped ...]


More information about the commits mailing list