[java-opensaml COMMIT] in /trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl: BlacklistPredicate.java...

noreply at shibboleth.net noreply at shibboleth.net
Wed May 7 21:44:00 EDT 2014


Author: putmanb
Date: Wed May  7 21:44:00 2014
New Revision: 3846

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3846&view=rev
Log:
Use sets in whitelist/blacklist predicates.

Modified:
    trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/BlacklistPredicate.java
    trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/WhitelistPredicate.java

Modified: trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/BlacklistPredicate.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/BlacklistPredicate.java?rev=3846&r1=3845&r2=3846&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/BlacklistPredicate.java (original)
+++ trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/BlacklistPredicate.java Wed May  7 21:44:00 2014
@@ -27,7 +27,7 @@
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 
 /**
  * Predicate which implements an algorithm URI blacklist policy.
@@ -44,7 +44,7 @@
      */
     public BlacklistPredicate(@Nonnull Collection<String> algorithms) {
         Constraint.isNotNull(algorithms, "Blacklist may not be null");
-        blacklist = Lists.newArrayList(Collections2.filter(algorithms, Predicates.notNull()));
+        blacklist = Sets.newHashSet(Collections2.filter(algorithms, Predicates.notNull()));
     }
 
     /** {@inheritDoc} */

Modified: trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/WhitelistPredicate.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/WhitelistPredicate.java?rev=3846&r1=3845&r2=3846&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/WhitelistPredicate.java (original)
+++ trunk/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/WhitelistPredicate.java Wed May  7 21:44:00 2014
@@ -27,7 +27,7 @@
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 
 /**
  * Predicate which implements an algorithm URI whitelist policy.
@@ -45,7 +45,7 @@
      */
     public WhitelistPredicate(@Nonnull Collection<String> algorithms) {
         Constraint.isNotNull(algorithms, "Whitelist may not be null");
-        whitelist = Lists.newArrayList(Collections2.filter(algorithms, Predicates.notNull()));
+        whitelist = Sets.newHashSet(Collections2.filter(algorithms, Predicates.notNull()));
     }
 
     /** {@inheritDoc} */



More information about the commits mailing list