[java-identity-provider] 01/06: Composed Matchers: The order of the children matters

Rod Widdowson rdw at steadingsoftware.com
Sun Jan 31 14:04:37 UTC 2021


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=10ae2b547a55cc59b418165903e837448b89e2bf

commit 10ae2b547a55cc59b418165903e837448b89e2bf
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Jan 29 13:44:48 2021 +0000

    Composed Matchers: The order of the children matters
    
    Change a few Collection definition into List.  These (impl) apis
    were being given Lists by the parser but this closes the syntactic
    loophole.
---
 .../attribute/filter/matcher/logic/impl/AbstractComposedMatcher.java  | 3 +--
 .../filter/policyrule/logic/impl/AbstractComposedPolicyRule.java      | 3 +--
 .../filter/matcher/logic/impl/AbstractComposedMatcherTest.java        | 3 +--
 .../idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java       | 4 ++--
 .../idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java        | 4 ++--
 .../filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java  | 3 +--
 .../idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java | 4 ++--
 .../idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java  | 4 ++--
 8 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcher.java b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcher.java
index 47a220d5b..a203c792f 100644
--- a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcher.java
+++ b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcher.java
@@ -17,7 +17,6 @@
 
 package net.shibboleth.idp.attribute.filter.matcher.logic.impl;
 
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -47,7 +46,7 @@ public abstract class AbstractComposedMatcher extends AbstractIdentifiableInitia
      * Called "subsidiaries" to allow easier parsing.
      * @param composedMatchers the matchers to be composed.
      */
-    public void setSubsidiaries(@Nullable @NonnullElements final Collection<Matcher> composedMatchers) {
+    public void setSubsidiaries(@Nullable @NonnullElements final List<Matcher> composedMatchers) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
         if (composedMatchers != null) {
diff --git a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRule.java b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRule.java
index f660b04a2..58b98506f 100644
--- a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRule.java
+++ b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRule.java
@@ -17,7 +17,6 @@
 
 package net.shibboleth.idp.attribute.filter.policyrule.logic.impl;
 
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -49,7 +48,7 @@ public abstract class AbstractComposedPolicyRule extends AbstractIdentifiableIni
      * Called "subsidiaries" to allow easier parsing.
      * @param theRules the rules to be composed.
      */
-    public void setSubsidiaries(@Nullable @NonnullElements final Collection<PolicyRequirementRule> theRules) {
+    public void setSubsidiaries(@Nullable @NonnullElements final List<PolicyRequirementRule> theRules) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
         if (theRules != null) {
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
index a58e0a0cb..25d05385d 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
@@ -21,7 +21,6 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
@@ -122,7 +121,7 @@ public class AbstractComposedMatcherTest {
          * 
          * @param composedMatchers ...
          */
-        public ComposedMatcher(final Collection<Matcher> composedMatchers) {
+        public ComposedMatcher(final List<Matcher> composedMatchers) {
             super();
             setSubsidiaries(composedMatchers);
         }
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
index 155c6c89d..6142599e7 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
@@ -26,8 +26,8 @@ import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 import java.util.Set;
 
 import javax.annotation.Nonnull;
@@ -160,7 +160,7 @@ public class AndMatcherTest extends AbstractMatcherPolicyRuleTest {
         assertTrue(matcher.getMatchingValues(attribute, filterContext).isEmpty());
     }
     
-    static public AndMatcher newAndMatcher(final @Nonnull @NonnullElements Collection<Matcher> what) {
+    static public AndMatcher newAndMatcher(final @Nonnull @NonnullElements List<Matcher> what) {
         final AndMatcher matcher = new AndMatcher();
         matcher.setSubsidiaries(what);
         return matcher;
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
index 660f7e871..89634a36c 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
@@ -26,8 +26,8 @@ import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 import java.util.Set;
 import java.util.function.Predicate;
 
@@ -185,7 +185,7 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
         matcher.initialize();
     }
     
-    static public OrMatcher newOrMatcher(final Collection<Matcher> what) {
+    static public OrMatcher newOrMatcher(final List<Matcher> what) {
         final OrMatcher matcher = new OrMatcher();
         matcher.setSubsidiaries(what);
         return matcher;
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
index 5013dca40..98b64cba7 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
@@ -21,7 +21,6 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -126,7 +125,7 @@ public class AbstractComposedPolicyRuleTest {
          *
          * @param composedMatchers ...
          */
-        public ComposedPolicyRule(final Collection<PolicyRequirementRule> composedMatchers) {
+        public ComposedPolicyRule(final List<PolicyRequirementRule> composedMatchers) {
             super();
             setSubsidiaries(composedMatchers);
         }
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java
index f154331ae..0c7e8f848 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java
@@ -21,8 +21,8 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.fail;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 
 import javax.annotation.Nullable;
 
@@ -103,7 +103,7 @@ public class AndPolicyRuleTest extends AbstractMatcherPolicyRuleTest {
         assertEquals(rule.matches(DataSources.unPopulatedFilterContext()), Tristate.TRUE);
     }
     
-    public static AndPolicyRule newAndPolicyRule(@Nullable final Collection<PolicyRequirementRule> composedRules) {
+    public static AndPolicyRule newAndPolicyRule(@Nullable final List<PolicyRequirementRule> composedRules) {
         final AndPolicyRule  rule = new AndPolicyRule();
         rule.setSubsidiaries(composedRules);
         return rule;
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java
index 260cecb0f..ceca70e74 100644
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java
+++ b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java
@@ -21,8 +21,8 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.fail;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 
 import javax.annotation.Nullable;
 
@@ -112,7 +112,7 @@ public class OrPolicyRuleTest extends AbstractMatcherPolicyRuleTest {
         assertEquals(rule.matches(DataSources.unPopulatedFilterContext()), Tristate.TRUE);
     }
 
-    public static OrPolicyRule newOrPolicyRule(@Nullable final Collection<PolicyRequirementRule> composedRules) {
+    public static OrPolicyRule newOrPolicyRule(@Nullable final List<PolicyRequirementRule> composedRules) {
         final OrPolicyRule  rule = new OrPolicyRule();
         rule.setSubsidiaries(composedRules);
         return rule;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list