[java-metadata-aggregator COMMIT] /trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage...

noreply at shibboleth.net noreply at shibboleth.net
Wed May 28 13:21:23 EDT 2014


Author: iay
Date: Wed May 28 13:21:22 2014
New Revision: 367

URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=367&view=rev
Log:
Enforce some constraints on the collectionPredicate property setter.

Modified:
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage.java

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage.java?rev=367&r1=366&r2=367&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/BaseStage.java Wed May 28 13:21:22 2014
@@ -31,6 +31,7 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.logic.Constraint;
 
 /**
  * A base class for {@link Stage} implementations.
@@ -54,8 +55,11 @@
      * @param pred the {@link Predicate} applied to the supplied item collection to determine
      * whether the stage will be executed
      */
-    public void setCollectionPredicate(@Nonnull Predicate<Collection<Item<T>>> pred) {
-        collectionPredicate = pred;
+    public void setCollectionPredicate(@Nonnull final Predicate<Collection<Item<T>>> pred) {
+        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
+        collectionPredicate = Constraint.isNotNull(pred, "collectionPredicate may not be null");
     }
     
     /**



More information about the commits mailing list