commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joe...@apache.org
Subject svn commit: r1356957 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java
Date Tue, 03 Jul 2012 21:25:09 GMT
Author: joehni
Date: Tue Jul  3 21:25:08 2012
New Revision: 1356957

URL: http://svn.apache.org/viewvc?rev=1356957&view=rev
Log:
More var-args. Clean-up.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java?rev=1356957&r1=1356956&r2=1356957&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/PredicateUtils.java
Tue Jul  3 21:25:08 2012
@@ -67,10 +67,7 @@ import org.apache.commons.collections.fu
  * All the supplied predicates are Serializable.
  *
  * @since Commons Collections 3.0
- * @version $Revision$
- *
- * @author Stephen Colebourne
- * @author Ola Berg
+ * @version $Id$
  */
 public class PredicateUtils {
 
@@ -284,7 +281,7 @@ public class PredicateUtils {
      * @deprecated use {@link AllPredicate#allPredicate(Predicate...)} instead.
      */
     @Deprecated
-    public static <T> Predicate<T> allPredicate(Predicate<? super T>[]
predicates) {
+    public static <T> Predicate<T> allPredicate(Predicate<? super T>...
predicates) {
         return AllPredicate.allPredicate(predicates);
     }
 
@@ -331,7 +328,7 @@ public class PredicateUtils {
      * @throws IllegalArgumentException if the predicates array is null
      * @throws IllegalArgumentException if any predicate in the array is null
      */
-    public static <T> Predicate<T> anyPredicate(Predicate<? super T>[]
predicates) {
+    public static <T> Predicate<T> anyPredicate(Predicate<? super T>...
predicates) {
         return AnyPredicate.anyPredicate(predicates);
     }
 
@@ -362,9 +359,10 @@ public class PredicateUtils {
      * @return the <code>either</code> predicate
      * @throws IllegalArgumentException if either predicate is null
      */
-    @SuppressWarnings("unchecked")
     public static <T> Predicate<T> eitherPredicate(Predicate<? super T>
predicate1, Predicate<? super T> predicate2) {
-        return onePredicate(new Predicate[] { predicate1, predicate2 });
+        @SuppressWarnings("unchecked")
+        Predicate<T> onePredicate = onePredicate(predicate1, predicate2);
+        return onePredicate;
     }
 
     /**
@@ -379,7 +377,7 @@ public class PredicateUtils {
      * @throws IllegalArgumentException if the predicates array is null
      * @throws IllegalArgumentException if any predicate in the array is null
      */
-    public static <T> Predicate<T> onePredicate(Predicate<? super T>[]
predicates) {
+    public static <T> Predicate<T> onePredicate(Predicate<? super T>...
predicates) {
         return OnePredicate.onePredicate(predicates);
     }
 
@@ -410,9 +408,10 @@ public class PredicateUtils {
      * @return the <code>neither</code> predicate
      * @throws IllegalArgumentException if either predicate is null
      */
-    @SuppressWarnings("unchecked")
     public static <T> Predicate<T> neitherPredicate(Predicate<? super T>
predicate1, Predicate<? super T> predicate2) {
-        return nonePredicate(new Predicate[] { predicate1, predicate2 });
+        @SuppressWarnings("unchecked")
+        Predicate<T> nonePredicate = nonePredicate(predicate1, predicate2);
+        return nonePredicate;
     }
 
     /**
@@ -427,7 +426,7 @@ public class PredicateUtils {
      * @throws IllegalArgumentException if the predicates array is null
      * @throws IllegalArgumentException if any predicate in the array is null
      */
-    public static <T> Predicate<T> nonePredicate(Predicate<? super T>[]
predicates) {
+    public static <T> Predicate<T> nonePredicate(Predicate<? super T>...
predicates) {
         return NonePredicate.nonePredicate(predicates);
     }
 



Mime
View raw message