From 501b94143a4c0a40c2bd44499a3e63c361b056f0 Mon Sep 17 00:00:00 2001 From: Brent Worden Date: Fri, 20 May 2011 13:04:44 +0000 Subject: [PATCH] [COLLECTIONS-229] removed remaining deprecated methods. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1125367 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections/PredicateUtils.java | 76 ------------------- .../collections/functors/AllPredicate.java | 34 --------- .../collections/functors/EqualPredicate.java | 16 ---- .../collections/functors/FalsePredicate.java | 12 --- .../collections/functors/NullPredicate.java | 12 --- .../collections/functors/TruePredicate.java | 12 --- .../commons/collections/map/LazyMap.java | 26 ------- .../collections/map/LazySortedMap.java | 25 ------ 8 files changed, 213 deletions(-) diff --git a/src/java/org/apache/commons/collections/PredicateUtils.java b/src/java/org/apache/commons/collections/PredicateUtils.java index d37fb5b25..7ef71ea0e 100644 --- a/src/java/org/apache/commons/collections/PredicateUtils.java +++ b/src/java/org/apache/commons/collections/PredicateUtils.java @@ -21,9 +21,7 @@ import java.util.Collection; import org.apache.commons.collections.functors.AllPredicate; import org.apache.commons.collections.functors.AndPredicate; import org.apache.commons.collections.functors.AnyPredicate; -import org.apache.commons.collections.functors.EqualPredicate; import org.apache.commons.collections.functors.ExceptionPredicate; -import org.apache.commons.collections.functors.FalsePredicate; import org.apache.commons.collections.functors.IdentityPredicate; import org.apache.commons.collections.functors.InstanceofPredicate; import org.apache.commons.collections.functors.InvokerTransformer; @@ -33,12 +31,10 @@ import org.apache.commons.collections.functors.NotPredicate; import org.apache.commons.collections.functors.NullIsExceptionPredicate; import org.apache.commons.collections.functors.NullIsFalsePredicate; import org.apache.commons.collections.functors.NullIsTruePredicate; -import org.apache.commons.collections.functors.NullPredicate; import org.apache.commons.collections.functors.OnePredicate; import org.apache.commons.collections.functors.OrPredicate; import org.apache.commons.collections.functors.TransformedPredicate; import org.apache.commons.collections.functors.TransformerPredicate; -import org.apache.commons.collections.functors.TruePredicate; import org.apache.commons.collections.functors.UniquePredicate; /** @@ -96,45 +92,6 @@ public class PredicateUtils { return ExceptionPredicate.getInstance(); } - /** - * Gets a Predicate that always returns true. - * - * @see org.apache.commons.collections.functors.TruePredicate - * - * @return the predicate - * @deprecated use {@link TruePredicate#truePredicate()} instead. - */ - @Deprecated - public static Predicate truePredicate() { - return TruePredicate.truePredicate(); - } - - /** - * Gets a Predicate that always returns false. - * - * @see org.apache.commons.collections.functors.FalsePredicate - * - * @return the predicate - * @deprecated use {@link FalsePredicate#falsePredicate()} instead. - */ - @Deprecated - public static Predicate falsePredicate() { - return FalsePredicate.getInstance(); - } - - /** - * Gets a Predicate that checks if the input object passed in is null. - * - * @see org.apache.commons.collections.functors.NullPredicate - * - * @return the predicate - * @deprecated use {@link NullPredicate#nullPredicate()} instead - */ - @Deprecated - public static Predicate nullPredicate() { - return NullPredicate.nullPredicate(); - } - /** * Gets a Predicate that checks if the input object passed in is not null. * @@ -146,21 +103,6 @@ public class PredicateUtils { return NotNullPredicate.getInstance(); } - /** - * Creates a Predicate that checks if the input object is equal to the - * specified object using equals(). - * - * @see org.apache.commons.collections.functors.EqualPredicate - * - * @param value the value to compare against - * @return the predicate - * @deprecated use {@link EqualPredicate#equalPredicate(Object)} instead. - */ - @Deprecated - public static Predicate equalPredicate(T value) { - return EqualPredicate.equalPredicate(value); - } - /** * Creates a Predicate that checks if the input object is equal to the * specified object by identity. @@ -270,24 +212,6 @@ public class PredicateUtils { return AndPredicate.getInstance(predicate1, predicate2); } - /** - * Create a new Predicate that returns true only if all of the specified - * predicates are true. - * If the array of predicates is empty, then this predicate returns true. - * - * @see org.apache.commons.collections.functors.AllPredicate - * - * @param predicates an array of predicates to check, may not be null - * @return the all predicate - * @throws IllegalArgumentException if the predicates array is null - * @throws IllegalArgumentException if any predicate in the array is null - * @deprecated use {@link AllPredicate#allPredicate(Predicate...)} instead. - */ - @Deprecated - public static Predicate allPredicate(Predicate[] predicates) { - return AllPredicate.allPredicate(predicates); - } - /** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. diff --git a/src/java/org/apache/commons/collections/functors/AllPredicate.java b/src/java/org/apache/commons/collections/functors/AllPredicate.java index 85ef4c844..7430e8e83 100644 --- a/src/java/org/apache/commons/collections/functors/AllPredicate.java +++ b/src/java/org/apache/commons/collections/functors/AllPredicate.java @@ -48,23 +48,6 @@ public final class AllPredicate implements Predicate, PredicateDecorator[] iPredicates; - /** - * Factory to create the predicate. - *

- * If the array is size zero, the predicate always returns true. - * If the array is size one, then that predicate is returned. - * - * @param predicates the predicates to check, cloned, not null - * @return the all predicate - * @throws IllegalArgumentException if the predicates array is null - * @throws IllegalArgumentException if any predicate in the array is null - * @deprecated Use {@link #allPredicate(Predicate...)} instead - */ - @Deprecated - public static Predicate getInstance(Predicate ... predicates) { - return allPredicate(predicates); - } - /** * Factory to create the predicate. *

@@ -88,23 +71,6 @@ public final class AllPredicate implements Predicate, PredicateDecorator(FunctorUtils.copy(predicates)); } - /** - * Factory to create the predicate. - *

- * If the collection is size zero, the predicate always returns true. - * If the collection is size one, then that predicate is returned. - * - * @param predicates the predicates to check, cloned, not null - * @return the all predicate - * @throws IllegalArgumentException if the predicates array is null - * @throws IllegalArgumentException if any predicate in the array is null - * @deprecated Use {@link #allPredicate(Collection)} instead - */ - @Deprecated - public static Predicate getInstance(Collection> predicates) { - return allPredicate(predicates); - } - /** * Factory to create the predicate. *

diff --git a/src/java/org/apache/commons/collections/functors/EqualPredicate.java b/src/java/org/apache/commons/collections/functors/EqualPredicate.java index f9d63f18b..e609be7cc 100644 --- a/src/java/org/apache/commons/collections/functors/EqualPredicate.java +++ b/src/java/org/apache/commons/collections/functors/EqualPredicate.java @@ -39,22 +39,6 @@ public final class EqualPredicate implements Predicate, Serializable { /** The value to compare to */ private final Object iValue; - /** - * Factory to create the identity predicate. - * - * @param object the object to compare to - * @return the predicate - * @throws IllegalArgumentException if the predicate is null - * @deprecated use {@link #equalPredicate(Object)} instead. - */ - @Deprecated - public static Predicate getInstance(T object) { - if (object == null) { - return nullPredicate(); - } - return new EqualPredicate(object); - } - /** * Factory to create the identity predicate. * diff --git a/src/java/org/apache/commons/collections/functors/FalsePredicate.java b/src/java/org/apache/commons/collections/functors/FalsePredicate.java index 1cbf89485..e67008e66 100644 --- a/src/java/org/apache/commons/collections/functors/FalsePredicate.java +++ b/src/java/org/apache/commons/collections/functors/FalsePredicate.java @@ -36,18 +36,6 @@ public final class FalsePredicate implements Predicate, Serializable { /** Singleton predicate instance */ public static final Predicate INSTANCE = new FalsePredicate(); - /** - * Get a typed instance. - * - * @return the singleton instance - * @since Commons Collections 3.1 - * @deprecated use {@link #falsePredicate()} instead. - */ - @Deprecated - public static Predicate getInstance() { - return FalsePredicate.falsePredicate(); - } - /** * Get a typed instance. * diff --git a/src/java/org/apache/commons/collections/functors/NullPredicate.java b/src/java/org/apache/commons/collections/functors/NullPredicate.java index b2931f153..80a19b179 100644 --- a/src/java/org/apache/commons/collections/functors/NullPredicate.java +++ b/src/java/org/apache/commons/collections/functors/NullPredicate.java @@ -36,18 +36,6 @@ public final class NullPredicate implements Predicate, Serializable { /** Singleton predicate instance */ public static final Predicate INSTANCE = new NullPredicate(); - /** - * Factory returning the singleton instance. - * - * @return the singleton instance - * @since Commons Collections 3.1 - * @deprecated use {@link #nullPredicate()} instead. - */ - @Deprecated - public static Predicate getInstance() { - return nullPredicate(); - } - /** * Factory returning the singleton instance. * diff --git a/src/java/org/apache/commons/collections/functors/TruePredicate.java b/src/java/org/apache/commons/collections/functors/TruePredicate.java index 21e5644d5..537848a2b 100644 --- a/src/java/org/apache/commons/collections/functors/TruePredicate.java +++ b/src/java/org/apache/commons/collections/functors/TruePredicate.java @@ -37,18 +37,6 @@ public final class TruePredicate implements Predicate, Serializable { /** Singleton predicate instance */ public static final Predicate INSTANCE = new TruePredicate(); - /** - * Factory returning the singleton instance. - * - * @return the singleton instance - * @since Commons Collections 3.1 - * @deprecated - */ - @Deprecated - public static Predicate getInstance() { - return truePredicate(); - } - /** * Factory returning the singleton instance. * diff --git a/src/java/org/apache/commons/collections/map/LazyMap.java b/src/java/org/apache/commons/collections/map/LazyMap.java index 6651f26eb..9d280c292 100644 --- a/src/java/org/apache/commons/collections/map/LazyMap.java +++ b/src/java/org/apache/commons/collections/map/LazyMap.java @@ -70,19 +70,6 @@ public class LazyMap extends AbstractMapDecorator implements Map factory; - /** - * Factory method to create a lazily instantiated map. - * - * @param map the map to decorate, must not be null - * @param factory the factory to use, must not be null - * @throws IllegalArgumentException if map or factory is null - * @deprecated use {@link #getLazyMap(Map, Factory)} instead. - */ - @Deprecated - public static Map decorate(Map map, Factory factory) { - return getLazyMap(map, factory); - } - /** * Factory method to create a lazily instantiated map. * @@ -94,19 +81,6 @@ public class LazyMap extends AbstractMapDecorator implements Map(map, factory); } - /** - * Factory method to create a lazily instantiated map. - * - * @param map the map to decorate, must not be null - * @param factory the factory to use, must not be null - * @throws IllegalArgumentException if map or factory is null - * @deprecated use {@link #getLazyMap(Map, Transformer)} instead. - */ - @Deprecated - public static Map decorate(Map map, Transformer factory) { - return getLazyMap(map, factory); - } - /** * Factory method to create a lazily instantiated map. * diff --git a/src/java/org/apache/commons/collections/map/LazySortedMap.java b/src/java/org/apache/commons/collections/map/LazySortedMap.java index 4cb7d68a6..f6f0e2c64 100644 --- a/src/java/org/apache/commons/collections/map/LazySortedMap.java +++ b/src/java/org/apache/commons/collections/map/LazySortedMap.java @@ -65,18 +65,6 @@ public class LazySortedMap /** Serialization version */ private static final long serialVersionUID = 2715322183617658933L; - /** - * Factory method to create a lazily instantiated sorted map. - * - * @param map the map to decorate, must not be null - * @param factory the factory to use, must not be null - * @throws IllegalArgumentException if map or factory is null - * @deprecated - */ - @Deprecated - public static SortedMap decorate(SortedMap map, Factory factory) { - return getLazySortedMap(map, factory); - } /** * Factory method to create a lazily instantiated sorted map. @@ -89,19 +77,6 @@ public class LazySortedMap return new LazySortedMap(map, factory); } - /** - * Factory method to create a lazily instantiated sorted map. - * - * @param map the map to decorate, must not be null - * @param factory the factory to use, must not be null - * @throws IllegalArgumentException if map or factory is null - * @deprecated - */ - @Deprecated - public static SortedMap decorate(SortedMap map, Transformer factory) { - return getLazySortedMap(map, factory); - } - /** * Factory method to create a lazily instantiated sorted map. *