commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1234990 [1/2] - in /commons/proper/functor/trunk: ./ src/main/java/org/apache/commons/functor/adapter/ src/main/java/org/apache/commons/functor/core/algorithm/ src/main/java/org/apache/commons/functor/core/collection/ src/main/java/org/apa...
Date Mon, 23 Jan 2012 21:18:13 GMT
Author: mbenson
Date: Mon Jan 23 21:18:10 2012
New Revision: 1234990

URL: http://svn.apache.org/viewvc?rev=1234990&view=rev
Log:
[FUNCTOR-10] throw NullPointerException for illegal null values

Modified:
    commons/proper/functor/trunk/NOTICE.txt
    commons/proper/functor/trunk/pom.xml
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateUnaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureUnaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/RecursiveEvaluation.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/FilteredGenerator.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateUntil.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateWhile.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/TransformedGenerator.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/UntilGenerate.java
    commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/WhileGenerate.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestSize.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java

Modified: commons/proper/functor/trunk/NOTICE.txt
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/NOTICE.txt?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/NOTICE.txt (original)
+++ commons/proper/functor/trunk/NOTICE.txt Mon Jan 23 21:18:10 2012
@@ -1,5 +1,5 @@
 Apache Commons Functor
-Copyright 2003-2004, 2008 The Apache Software Foundation
+Copyright 2003-2004, 2008-2012 The Apache Software Foundation
 
 This product includes software developed by
 The Apache Software Foundation (http://www.apache.org/).

Modified: commons/proper/functor/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/pom.xml?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/pom.xml (original)
+++ commons/proper/functor/trunk/pom.xml Mon Jan 23 21:18:10 2012
@@ -22,7 +22,6 @@
     <version>22</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.commons</groupId>
   <artifactId>commons-functor</artifactId>
   <version>1.0-SNAPSHOT</version>
   <name>Commons Functor</name>
@@ -90,6 +89,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <!-- if upgrading, be sure to check shaded jar relocations! -->
+      <version>3.1</version>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.10</version>
@@ -129,6 +134,63 @@
           <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.5</version>
+        <configuration>
+          <minimizeJar>true</minimizeJar>
+          <createDependencyReducedPom>true</createDependencyReducedPom>
+          <createSourcesJar>true</createSourcesJar>
+          <artifactSet>
+            <includes>
+              <include>org.apache.commons:commons-lang3</include>
+            </includes>
+          </artifactSet>
+          <relocations>
+            <relocation>
+              <pattern>org.apache.commons.lang3.builder.</pattern>
+              <shadedPattern>org.apache.commons.functor._lang3.builder.__</shadedPattern>
+            </relocation>
+            <relocation>
+              <pattern>org.apache.commons.lang3.exception.</pattern>
+              <shadedPattern>org.apache.commons.functor._lang3.exception.__</shadedPattern>
+            </relocation>
+            <relocation>
+              <pattern>org.apache.commons.lang3.mutable.</pattern>
+              <shadedPattern>org.apache.commons.functor._lang3.mutable.__</shadedPattern>
+            </relocation>
+            <relocation>
+              <pattern>org.apache.commons.lang3.tuple.</pattern>
+              <shadedPattern>org.apache.commons.functor._lang3.tuple.__</shadedPattern>
+            </relocation>
+            <relocation>
+              <pattern>org.apache.commons.lang3.</pattern>
+              <shadedPattern>org.apache.commons.functor._lang3.__</shadedPattern>
+            </relocation>
+          </relocations>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
 
     <!--
@@ -142,6 +204,56 @@
         <version>1.0</version>
       </extension>
     </extensions>
+    <pluginManagement>
+    	<plugins>
+    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+    		<plugin>
+    			<groupId>org.eclipse.m2e</groupId>
+    			<artifactId>lifecycle-mapping</artifactId>
+    			<version>1.0.0</version>
+    			<configuration>
+    				<lifecycleMappingMetadata>
+    					<pluginExecutions>
+    						<pluginExecution>
+    							<pluginExecutionFilter>
+    								<groupId>
+    									org.apache.maven.plugins
+    								</groupId>
+    								<artifactId>
+    									maven-antrun-plugin
+    								</artifactId>
+    								<versionRange>[1.6,)</versionRange>
+    								<goals>
+    									<goal>run</goal>
+    								</goals>
+    							</pluginExecutionFilter>
+    							<action>
+    								<ignore></ignore>
+    							</action>
+    						</pluginExecution>
+    						<pluginExecution>
+    							<pluginExecutionFilter>
+    								<groupId>org.apache.felix</groupId>
+    								<artifactId>
+    									maven-bundle-plugin
+    								</artifactId>
+    								<versionRange>
+    									[2.3.5,)
+    								</versionRange>
+    								<goals>
+    									<goal>manifest</goal>
+    								</goals>
+    							</pluginExecutionFilter>
+    							<action>
+    								<ignore></ignore>
+    							</action>
+    						</pluginExecution>
+    					</pluginExecutions>
+    				</lifecycleMappingMetadata>
+    			</configuration>
+    		</plugin>
+    	</plugins>
+    </pluginManagement>
   </build>
   <reporting>
     <plugins>

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a <code>Boolean</code>-valued {@link BinaryFunction BinaryFunction} to
@@ -47,10 +48,7 @@ public final class BinaryFunctionBinaryP
      * @param function the {@link BinaryFunction BinaryFunction} to wrap
      */
     public BinaryFunctionBinaryPredicate(final BinaryFunction<? super L, ? super R, Boolean> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("BinaryFunction argument must not be null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "BinaryFunction argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.adapt
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a BinaryFunction as a UnaryFunction by sending the same argument to both sides of the BinaryFunction.
@@ -38,10 +39,7 @@ public final class BinaryFunctionUnaryFu
      * @param function to adapt
      */
     public BinaryFunctionUnaryFunction(BinaryFunction<? super A, ? super A, ? extends T> function) {
-        if (null == function) {
-            throw new IllegalArgumentException("BinaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "BinaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.adapt
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a BinaryPredicate as a UnaryPredicate by sending the same argument to both sides of the BinaryPredicate.
@@ -36,10 +37,7 @@ public final class BinaryPredicateUnaryP
      * @param predicate to adapt
      */
     public BinaryPredicateUnaryPredicate(BinaryPredicate<? super A, ? super A> predicate) {
-        if (null == predicate) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "BinaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.BinaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -54,10 +55,7 @@ public final class BinaryProcedureBinary
      * @param procedure to adapt as a BinaryFunction
      */
     public BinaryProcedureBinaryFunction(BinaryProcedure<? super L, ? super R> procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "BinaryProcedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureUnaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureUnaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureUnaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.adapt
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a BinaryProcedure as a UnaryProcedure by sending the same argument to both sides of the BinaryProcedure.
@@ -36,10 +37,7 @@ public final class BinaryProcedureUnaryP
      * @param procedure to adapt
      */
     public BinaryProcedureUnaryProcedure(BinaryProcedure<? super A, ? super A> procedure) {
-        if (null == procedure) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "BinaryProcedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -57,10 +58,9 @@ public final class BoundFunction<T> impl
      */
     @SuppressWarnings("unchecked")
     public <A> BoundFunction(UnaryFunction<? super A, ? extends T> function, A arg) {
-        if (function == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.function = (UnaryFunction<Object, ? extends T>) function;
+        this.function =
+            (UnaryFunction<Object, ? extends T>) Validate.notNull(function,
+                "UnaryFunction argument was null");
         this.arg = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Predicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -56,10 +57,9 @@ public final class BoundPredicate implem
      */
     @SuppressWarnings("unchecked")
     public <A> BoundPredicate(UnaryPredicate<? super A> predicate, A arg) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.predicate = (UnaryPredicate<Object>) predicate;
+        this.predicate =
+            (UnaryPredicate<Object>) Validate.notNull(predicate,
+                "UnaryPredicate argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Procedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -56,10 +57,9 @@ public final class BoundProcedure implem
      */
     @SuppressWarnings("unchecked")
     public <A> BoundProcedure(UnaryProcedure<? super A> procedure, A arg) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("UnaryProcedure argument was null");
-        }
-        this.procedure = (UnaryProcedure<Object>) procedure;
+        this.procedure =
+            (UnaryProcedure<Object>) Validate.notNull(procedure,
+                "UnaryProcedure argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.Function;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -61,10 +62,9 @@ public final class FullyBoundFunction<T>
      */
     @SuppressWarnings("unchecked")
     public <L, R> FullyBoundFunction(BinaryFunction<? super L, ? super R, ? extends T> function, L left, R right) {
-        if (function == null) {
-            throw new IllegalArgumentException("BinaryFunction argument was null");
-        }
-        this.function = (BinaryFunction<Object, Object, T>) function;
+        this.function =
+            (BinaryFunction<Object, Object, T>) Validate.notNull(function,
+                "BinaryFunction argument was null");
         this.left = left;
         this.right = right;
     }

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -61,10 +62,9 @@ public final class FullyBoundPredicate i
      */
     @SuppressWarnings("unchecked")
     public <L, R> FullyBoundPredicate(BinaryPredicate<? super L, ? super R> predicate, L left, R right) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.predicate = (BinaryPredicate<Object, Object>) predicate;
+        this.predicate =
+            (BinaryPredicate<Object, Object>) Validate.notNull(predicate,
+                "BinaryPredicate argument was null");
         this.left = left;
         this.right = right;
     }

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FullyBoundProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.Procedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -60,10 +61,9 @@ public final class FullyBoundProcedure i
      */
     @SuppressWarnings("unchecked")
     public <L, R> FullyBoundProcedure(BinaryProcedure<? super L, ? super R> procedure, L left, R right) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = (BinaryProcedure<Object, Object>) procedure;
+        this.procedure =
+            (BinaryProcedure<Object, Object>) Validate.notNull(procedure,
+                "BinaryProcedure argument was null");
         this.left = left;
         this.right = right;
     }

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a <code>Boolean</code>-valued
@@ -50,10 +51,7 @@ public final class FunctionPredicate imp
      * @param function to adapt
      */
     public FunctionPredicate(Function<Boolean> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("Function argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "Function argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Procedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a {@link Function Function}
@@ -51,10 +52,7 @@ public final class FunctionProcedure imp
      * @param function the {@link Function Function} to wrap
      */
     public FunctionProcedure(Function<?> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("Function argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "Function argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class FunctionUnaryFunction
      * @param function to adapt
      */
     public FunctionUnaryFunction(Function<? extends T> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("Function argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "Function argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -54,10 +55,7 @@ public final class IgnoreLeftFunction<L,
      * @param function UnaryFunction for right argument
      */
     public IgnoreLeftFunction(UnaryFunction<? super R, ? extends T> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "UnaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class IgnoreLeftPredicate<L
      * @param predicate the right predicate
      */
     public IgnoreLeftPredicate(UnaryPredicate<? super R> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class IgnoreLeftProcedure<L
      * @param procedure to adapt
      */
     public IgnoreLeftProcedure(UnaryProcedure<? super R> procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("UnaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "UnaryProcedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -54,10 +55,7 @@ public final class IgnoreRightFunction<L
      * @param function UnaryFunction to wrap
      */
     public IgnoreRightFunction(UnaryFunction<? super L, ? extends T> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "UnaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class IgnoreRightPredicate<
      * @param predicate left
      */
     public IgnoreRightPredicate(UnaryPredicate<? super L> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class IgnoreRightProcedure<
      * @param procedure UnaryProcedure to adapt
      */
     public IgnoreRightProcedure(UnaryProcedure<? super L> procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("UnaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "UnaryProcedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -58,10 +59,9 @@ public final class LeftBoundFunction<A, 
      */
     @SuppressWarnings("unchecked")
     public <L> LeftBoundFunction(BinaryFunction<? super L, ? super A, ? extends T> function, L arg) {
-        if (function == null) {
-            throw new IllegalArgumentException("BinaryFunction argument was null");
-        }
-        this.function = (BinaryFunction<Object, ? super A, ? extends T>) function;
+        this.function =
+            (BinaryFunction<Object, ? super A, ? extends T>) Validate.notNull(
+                function, "BinaryFunction argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -58,10 +59,9 @@ public final class LeftBoundPredicate<A>
      */
     @SuppressWarnings("unchecked")
     public <L> LeftBoundPredicate(BinaryPredicate<? super L, ? super A> predicate, L arg) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.predicate = (BinaryPredicate<Object, ? super A>) predicate;
+        this.predicate =
+            (BinaryPredicate<Object, ? super A>) Validate.notNull(predicate,
+                "BinaryPredicate argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -57,10 +58,9 @@ public final class LeftBoundProcedure<A>
      */
     @SuppressWarnings("unchecked")
     public <L> LeftBoundProcedure(BinaryProcedure<? super L, ? super A> procedure, L arg) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = (BinaryProcedure<Object, ? super A>) procedure;
+        this.procedure =
+            (BinaryProcedure<Object, ? super A>) Validate.notNull(procedure,
+                "BinaryProcedure argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -50,10 +51,7 @@ public final class PredicateFunction imp
      * @param predicate to adapt
      */
     public PredicateFunction(Predicate predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("Predicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "Predicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Predicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -52,10 +53,7 @@ public final class PredicateUnaryPredica
      * @param predicate to adapt
      */
     public PredicateUnaryPredicate(Predicate predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("Predicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "Predicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Procedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -52,10 +53,7 @@ public final class ProcedureFunction<T> 
      * @param procedure to adapt
      */
     public ProcedureFunction(Procedure procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("Procedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "Procedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Procedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -52,10 +53,7 @@ public final class ProcedureUnaryProcedu
      * @param procedure to adapt
      */
     public ProcedureUnaryProcedure(Procedure procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("Procedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "Procedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -57,10 +58,9 @@ public final class RightBoundFunction<A,
      */
     @SuppressWarnings("unchecked")
     public <R> RightBoundFunction(BinaryFunction<? super A, ? super R, ? extends T> function, R arg) {
-        if (function == null) {
-            throw new IllegalArgumentException("left-hand BinaryFunction argument was null");
-        }
-        this.function = (BinaryFunction<? super A, Object, ? extends T>) function;
+        this.function =
+            (BinaryFunction<? super A, Object, ? extends T>) Validate.notNull(
+                function, "left-hand BinaryFunction argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -57,10 +58,9 @@ public final class RightBoundPredicate<A
      */
     @SuppressWarnings("unchecked")
     public <R> RightBoundPredicate(BinaryPredicate<? super A, ? super R> predicate, R arg) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.predicate = (BinaryPredicate<? super A, Object>) predicate;
+        this.predicate =
+            (BinaryPredicate<? super A, Object>) Validate.notNull(predicate,
+                "BinaryPredicate argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -57,10 +58,9 @@ public final class RightBoundProcedure<A
      */
     @SuppressWarnings("unchecked")
     public <R> RightBoundProcedure(BinaryProcedure<? super A, ? super R> procedure, R arg) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = (BinaryProcedure<? super A, Object>) procedure;
+        this.procedure =
+            (BinaryProcedure<? super A, Object>) Validate.notNull(procedure,
+                "BinaryProcedure argument was null");
         this.param = arg;
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a <code>Boolean</code>-valued
@@ -52,10 +53,7 @@ public final class UnaryFunctionUnaryPre
      * @param function the {@link UnaryFunction UnaryFunction} to wrap
      */
     public UnaryFunctionUnaryPredicate(UnaryFunction<? super A, Boolean> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "UnaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a {@link UnaryFunction UnaryFunction}
@@ -53,10 +54,7 @@ public final class UnaryFunctionUnaryPro
      * @param function the {@link UnaryFunction UnaryFunction} to wrap
      */
     public UnaryFunctionUnaryProcedure(UnaryFunction<? super A, ?> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "UnaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -51,10 +52,7 @@ public final class UnaryPredicateUnaryFu
      * @param predicate to adapt
      */
     public UnaryPredicateUnaryFunction(UnaryPredicate<? super A> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a
@@ -53,10 +54,7 @@ public final class UnaryProcedureUnaryFu
      * @param procedure to adapt
      */
     public UnaryProcedureUnaryFunction(UnaryProcedure<? super A> procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("UnaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "UnaryProcedure argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/RecursiveEvaluation.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/RecursiveEvaluation.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/RecursiveEvaluation.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/RecursiveEvaluation.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Tail recursion for {@link Function functions}. If the {@link Function}
@@ -55,14 +56,12 @@ public class RecursiveEvaluation impleme
      * @param functionType as long as result is an instance, keep processing.
      */
     public RecursiveEvaluation(Function<?> function, Class<?> functionType) {
-        if (function == null) {
-            throw new IllegalArgumentException("Function argument was null");
-        }
-        if (functionType == null || !Function.class.isAssignableFrom(functionType)) {
+        Validate.notNull(function, "Function argument was null");
+        if (!Function.class.isAssignableFrom(functionType)) {
             throw new IllegalArgumentException(Function.class + " is not assignable from " + functionType);
         }
         this.function = function;
-        this.functionType = functionType;
+        this.functionType = Validate.notNull(functionType, "FunctionType argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Iterator that filters another Iterator by only passing through those elements
@@ -63,14 +64,8 @@ public final class FilteredIterator<T> i
      * @param predicate to apply
      */
     public FilteredIterator(Iterator<? extends T> iterator, UnaryPredicate<? super T> predicate) {
-        if (null == iterator) {
-            throw new IllegalArgumentException("Iterator argument was null");
-        }
-        if (null == predicate) {
-            throw new IllegalArgumentException("filtering UnaryPredicate argument was null");
-        }
-        this.predicate = predicate;
-        this.iterator = iterator;
+        this.iterator = Validate.notNull(iterator, "Iterator argument was null");
+        this.predicate = Validate.notNull(predicate, "filtering UnaryPredicate argument was null");
     }
 
     // iterator methods

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java Mon Jan 23 21:18:10 2012
@@ -23,6 +23,7 @@ import java.util.Collection;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate} that checks to see if the
@@ -63,15 +64,13 @@ public final class IsElementOf<L, R> imp
      * {@inheritDoc}
      */
     public boolean test(L obj, R col) {
+        Validate.notNull(col, "Right side argument must not be null.");
         if (col instanceof Collection<?>) {
             return testCollection(obj, (Collection<?>) col);
         }
-        if (null != col && col.getClass().isArray()) {
+        if (col.getClass().isArray()) {
             return testArray(obj, col);
         }
-        if (null == col) {
-            throw new IllegalArgumentException("Right side argument must not be null.");
-        }
         throw new IllegalArgumentException("Expected Collection or Array, found " + col.getClass());
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * @param <A> the predicate argument type.
@@ -57,6 +58,7 @@ public final class IsEmpty<A> implements
      * {@inheritDoc}
      */
     public boolean test(A obj) {
+        Validate.notNull(obj, "Argument must not be null");
         if (obj instanceof Collection<?>) {
             return testCollection((Collection<?>) obj);
         }
@@ -66,12 +68,9 @@ public final class IsEmpty<A> implements
         if (obj instanceof String) {
             return testString((String) obj);
         }
-        if (null != obj && obj.getClass().isArray()) {
+        if (obj.getClass().isArray()) {
             return testArray(obj);
         }
-        if (null == obj) {
-            throw new IllegalArgumentException("Argument must not be null");
-        }
         throw new IllegalArgumentException("Expected Collection, Map, String or Array, found " + obj.getClass());
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.lang.reflect.Array;
 import java.util.Collection;
 
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Returns the size of the specified Collection, or the length
@@ -52,18 +53,16 @@ public final class Size<A> implements Un
      * {@inheritDoc}
      */
     public Integer evaluate(Object obj) {
+        Validate.notNull(obj, "Argument must not be null");
         if (obj instanceof Collection<?>) {
             return evaluate((Collection<?>) obj);
         }
         if (obj instanceof String) {
             return evaluate((String) obj);
         }
-        if (null != obj && obj.getClass().isArray()) {
+        if (obj.getClass().isArray()) {
             return evaluateArray(obj);
         }
-        if (null == obj) {
-            throw new IllegalArgumentException("Argument must not be null");
-        }
         throw new IllegalArgumentException("Expected Collection, String or Array, found " + obj);
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.util.Iterator;
 
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Iterator that transforms another Iterator by applying a UnaryFunction to each returned element.
@@ -50,14 +51,8 @@ public final class TransformedIterator<E
      * @param function to apply
      */
     public TransformedIterator(Iterator<? extends E> iterator, UnaryFunction<? super E, ? extends T> function) {
-        if (null == iterator) {
-            throw new IllegalArgumentException("Iterator argument was null");
-        }
-        if (null == function) {
-            throw new IllegalArgumentException("filtering UnaryFunction argument was null");
-        }
-        this.function = function;
-        this.iterator = iterator;
+        this.function = Validate.notNull(function, "filtering UnaryFunction argument was null");
+        this.iterator = Validate.notNull(iterator, "Iterator argument was null");
     }
 
     // iterator methods

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 import java.util.Comparator;
 
 import org.apache.commons.functor.BinaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a {@link Comparator Comparator} to the
@@ -51,10 +52,7 @@ public final class ComparatorFunction<T>
      * @param comparator to wrap
      */
     public ComparatorFunction(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -70,10 +71,7 @@ public final class IsEquivalent<T> imple
      *        be used.
      */
     public IsEquivalent(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -69,10 +70,7 @@ public final class IsGreaterThan<T> impl
      *        be used.
      */
     public IsGreaterThan(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -70,10 +71,7 @@ public final class IsGreaterThanOrEqual<
      *        be used.
      */
     public IsGreaterThanOrEqual(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -69,10 +70,7 @@ public final class IsLessThan<T> impleme
      *        be used.
      */
     public IsLessThan(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -69,10 +70,7 @@ public final class IsLessThanOrEqual<T> 
      *        be used.
      */
     public IsLessThanOrEqual(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.RightBoundPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
@@ -70,10 +71,7 @@ public final class IsNotEquivalent<T> im
      *        be used.
      */
     public IsNotEquivalent(Comparator<? super T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.core.
 
 import java.io.Serializable;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryPredicate} that tests whether a {@link Comparable} object is
@@ -61,9 +62,8 @@ public class IsWithinRange<A extends Com
      * @param max Comparable
      */
     public IsWithinRange(A min, A max) {
-        if (min == null || max == null) {
-            throw new IllegalArgumentException("min and max must not be null");
-        }
+        Validate.notNull(min, "min must not be null");
+        Validate.notNull(max, "max must not be null");
         if (min.compareTo(max) > 0) {
             throw new IllegalArgumentException("min must be <= max");
         }

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.adapter.RightBoundFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a {@link Comparator Comparator} to the
@@ -61,10 +62,7 @@ public final class Max<T> implements Bin
      * @param comparator Comparator to use
      */
     public Max(Comparator<T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java Mon Jan 23 21:18:10 2012
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.adapter.RightBoundFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Adapts a {@link Comparator Comparator} to the
@@ -61,10 +62,7 @@ public final class Min<T> implements Bin
      * @param comparator to use
      */
     public Min(Comparator<T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("Comparator argument must not be null");
-        }
-        this.comparator = comparator;
+        this.comparator = Validate.notNull(comparator, "Comparator argument must not be null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Abstract base class for {@link BinaryPredicate BinaryPredicates}
@@ -116,10 +117,7 @@ abstract class BaseBinaryPredicateList<L
      * @param p BinaryPredicate to add
      */
     protected void addBinaryPredicate(BinaryPredicate<? super L, ? super R> p) {
-        if (p == null) {
-            throw new IllegalArgumentException("Cannot add null BinaryPredicate");
-        }
-        list.add(p);
+        list.add(Validate.notNull(p, "Cannot add null BinaryPredicate"));
     }
 
     // protected

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Abstract base class for {@link Predicate Predicates}
@@ -112,10 +113,7 @@ abstract class BasePredicateList impleme
      * @param p Predicate to add
      */
     protected void addPredicate(Predicate p) {
-        if (p == null) {
-            throw new IllegalArgumentException("Cannot add null Predicate");
-        }
-        list.add(p);
+        list.add(Validate.notNull(p, "Cannot add null Predicate"));
     }
 
     // protected



Mime
View raw message