[java-identity-provider COMMIT] in /trunk: idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute....

noreply at shibboleth.net noreply at shibboleth.net
Mon Jan 27 23:36:45 EST 2014


Author: dfisher
Date: Mon Jan 27 23:36:45 2014
New Revision: 5250

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5250&view=rev
Log:
IDP-357.
IdPAttributeValue should preserve order.
Use a LinkedHashSet for this purpose.

Modified:
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
    trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java

Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java?rev=5250&r1=5249&r2=5250&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java Mon Jan 27 23:36:45 2014
@@ -21,6 +21,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -80,7 +81,7 @@
         displayNames = Collections.emptyMap();
         displayDescriptions = Collections.emptyMap();
 
-        values = Constraints.constrainedSet(new HashSet<IdPAttributeValue<?>>(), Constraints.notNull());
+        values = Constraints.constrainedSet(new LinkedHashSet<IdPAttributeValue<?>>(), Constraints.notNull());
         encoders = Collections.emptySet();
     }
 
@@ -170,7 +171,7 @@
      */
     public void setValues(@Nullable @NullableElements final Collection<? extends IdPAttributeValue<?>> newValues) {
         Set<IdPAttributeValue<?>> checkedValues =
-                Constraints.constrainedSet(new HashSet<IdPAttributeValue<?>>(), Constraints.notNull());
+                Constraints.constrainedSet(new LinkedHashSet<IdPAttributeValue<?>>(), Constraints.notNull());
         CollectionSupport.addIf(checkedValues, newValues, Predicates.<IdPAttributeValue> notNull());
         values = checkedValues;
     }

Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java?rev=5250&r1=5249&r2=5250&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java (original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java Mon Jan 27 23:36:45 2014
@@ -19,7 +19,7 @@
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -62,7 +62,7 @@
         Constraint.isNotNull(workContext, "Attribute resolution context cannot be null");
         Constraint.isNotNull(dependencies, "Resolver dependency collection cannot be null");
 
-        final Set<IdPAttributeValue<?>> values = new HashSet<>();
+        final Set<IdPAttributeValue<?>> values = new LinkedHashSet<>();
 
         for (ResolverPluginDependency dependency : dependencies) {
             final IdPAttribute resolvedAttribute;
@@ -171,7 +171,7 @@
         }
         Set<IdPAttributeValue<?>> attributeValues = target.get(source.getId());
         if (attributeValues == null) {
-            attributeValues = new HashSet<>();
+            attributeValues = new LinkedHashSet<>();
             target.put(source.getId(), attributeValues);
         }
 

Modified: trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java?rev=5250&r1=5249&r2=5250&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java (original)
+++ trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java Mon Jan 27 23:36:45 2014
@@ -188,7 +188,8 @@
         return (BaseComputedIDDataConnector) resolver.getDataConnectors().get(TEST_CONNECTOR_NAME);
     }
 
-    @Test public void altDataConnector() throws ComponentInitializationException, ResolutionException {
+    //TODO: fix assertion on line 218, see IDP-357

[... 5 lines stripped ...]


More information about the commits mailing list