Author: tn
Date: Wed Nov 20 21:13:35 2013
New Revision: 1543950
URL: http://svn.apache.org/r1543950
Log:
[COLLECTIONS-502] remove generic parameters from static INSTANCE fields.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
Wed Nov 20 21:13:35 2013
@@ -46,7 +46,7 @@ public class ComparableComparator<E exte
/** The singleton instance. */
@SuppressWarnings("rawtypes")
- public static final ComparableComparator<?> INSTANCE = new
ComparableComparator();
+ public static final ComparableComparator INSTANCE = new
ComparableComparator();
//-----------------------------------------------------------------------
/**
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java
Wed Nov 20 21:13:35 2013
@@ -34,7 +34,8 @@ public class CloneTransformer<T> impleme
private static final long serialVersionUID = -8188742709499652567L;
/** Singleton predicate instance */
- public static final Transformer<Object, Object> INSTANCE = new
CloneTransformer<Object>();
+ @SuppressWarnings("rawtypes") // the singleton instance works for all types
+ public static final Transformer INSTANCE = new CloneTransformer<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java
Wed Nov 20 21:13:35 2013
@@ -36,7 +36,8 @@ public class ConstantFactory<T> implemen
private static final long serialVersionUID = -3520677225766901240L;
/** Returns null each time */
- public static final Factory<Object> NULL_INSTANCE = new
ConstantFactory<Object>(null);
+ @SuppressWarnings("rawtypes") // The null factory works for all object
types
+ public static final Factory NULL_INSTANCE = new
ConstantFactory<Object>(null);
/** The closures to call in turn */
private final T iConstant;
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java
Wed Nov 20 21:13:35 2013
@@ -36,7 +36,8 @@ public class ConstantTransformer<I, O> i
private static final long serialVersionUID = 6374440726369055124L;
/** Returns null each time */
- public static final Transformer<Object, Object> NULL_INSTANCE = new
ConstantTransformer<Object, Object>(null);
+ @SuppressWarnings("rawtypes")
+ public static final Transformer NULL_INSTANCE = new
ConstantTransformer<Object, Object>(null);
/** The closures to call in turn */
private final O iConstant;
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java
Wed Nov 20 21:13:35 2013
@@ -33,7 +33,8 @@ public class DefaultEquator<T> implement
private static final long serialVersionUID = 825802648423525485L;
/** Static instance */
- public static final DefaultEquator<Object> INSTANCE = new
DefaultEquator<Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final DefaultEquator INSTANCE = new DefaultEquator<Object>();
/**
* Hashcode used for <code>null</code> objects.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionClosure.java
Wed Nov 20 21:13:35 2013
@@ -33,7 +33,8 @@ public final class ExceptionClosure<E> i
private static final long serialVersionUID = 7179106032121985545L;
/** Singleton predicate instance */
- public static final Closure<Object> INSTANCE = new
ExceptionClosure<Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final Closure INSTANCE = new ExceptionClosure<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
Wed Nov 20 21:13:35 2013
@@ -33,7 +33,8 @@ public final class ExceptionFactory<T> i
private static final long serialVersionUID = 7179106032121985545L;
/** Singleton predicate instance */
- public static final Factory<Object> INSTANCE = new
ExceptionFactory<Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final Factory INSTANCE = new ExceptionFactory<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionPredicate.java
Wed Nov 20 21:13:35 2013
@@ -33,7 +33,8 @@ public final class ExceptionPredicate<T>
private static final long serialVersionUID = 7179106032121985545L;
/** Singleton predicate instance */
- public static final Predicate<Object> INSTANCE = new
ExceptionPredicate<Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final Predicate INSTANCE = new ExceptionPredicate<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/ExceptionTransformer.java
Wed Nov 20 21:13:35 2013
@@ -33,7 +33,8 @@ public final class ExceptionTransformer<
private static final long serialVersionUID = 7179106032121985545L;
/** Singleton predicate instance */
- public static final Transformer<Object, Object> INSTANCE = new
ExceptionTransformer<Object, Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final Transformer INSTANCE = new
ExceptionTransformer<Object, Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/FalsePredicate.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public final class FalsePredicate<T> imp
private static final long serialVersionUID = 7533784454832764388L;
/** Singleton predicate instance */
- public static final Predicate<Object> INSTANCE = new
FalsePredicate<Object>();
+ @SuppressWarnings("rawtypes") // the static instance works for all types
+ public static final Predicate INSTANCE = new FalsePredicate<Object>();
/**
* Get a typed instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/IfClosure.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/IfClosure.java
Wed Nov 20 21:13:35 2013
@@ -91,7 +91,7 @@ public class IfClosure<E> implements Clo
* @since 3.2
*/
public IfClosure(final Predicate<? super E> predicate, final Closure<?
super E> trueClosure) {
- this(predicate, trueClosure, NOPClosure.INSTANCE);
+ this(predicate, trueClosure, NOPClosure.nopClosure());
}
/**
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
Wed Nov 20 21:13:35 2013
@@ -35,7 +35,8 @@ public class InstantiateTransformer<T> i
private static final long serialVersionUID = 3786388740793356347L;
/** Singleton instance that uses the no arg constructor */
- public static final Transformer<Class<?>, ?> NO_ARG_INSTANCE = new
InstantiateTransformer<Object>();
+ @SuppressWarnings("rawtypes")
+ private static final Transformer NO_ARG_INSTANCE = new
InstantiateTransformer<Object>();
/** The constructor parameter types */
private final Class<?>[] iParamTypes;
@@ -48,8 +49,9 @@ public class InstantiateTransformer<T> i
* @param <T> the type of the objects to be created
* @return Transformer<Class<? extends T>, T>
*/
+ @SuppressWarnings("unchecked")
public static <T> Transformer<Class<? extends T>, T>
instantiateTransformer() {
- return new InstantiateTransformer<T>();
+ return (Transformer<Class<? extends T>, T>) NO_ARG_INSTANCE;
}
/**
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPClosure.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public final class NOPClosure<E> impleme
private static final long serialVersionUID = 3518477308466486130L;
/** Singleton predicate instance */
- public static final Closure<Object> INSTANCE = new NOPClosure<Object>();
+ @SuppressWarnings("rawtypes")
+ public static final Closure INSTANCE = new NOPClosure<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NOPTransformer.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public class NOPTransformer<T> implement
private static final long serialVersionUID = 2133891748318574490L;
/** Singleton predicate instance */
- public static final Transformer<Object, Object> INSTANCE = new
NOPTransformer<Object>();
+ @SuppressWarnings("rawtypes")
+ public static final Transformer INSTANCE = new NOPTransformer<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NotNullPredicate.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public final class NotNullPredicate<T> i
private static final long serialVersionUID = 7533784454832764388L;
/** Singleton predicate instance */
- public static final Predicate<Object> INSTANCE = new
NotNullPredicate<Object>();
+ @SuppressWarnings("rawtypes")
+ public static final Predicate INSTANCE = new NotNullPredicate<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/NullPredicate.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public final class NullPredicate<T> impl
private static final long serialVersionUID = 7533784454832764388L;
/** Singleton predicate instance */
- public static final Predicate<?> INSTANCE = new NullPredicate<Object>();
+ @SuppressWarnings("rawtypes")
+ public static final Predicate INSTANCE = new NullPredicate<Object>();
/**
* Factory returning the singleton instance.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java?rev=1543950&r1=1543949&r2=1543950&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/functors/TruePredicate.java
Wed Nov 20 21:13:35 2013
@@ -32,7 +32,8 @@ public final class TruePredicate<T> impl
private static final long serialVersionUID = 3374767158756189740L;
/** Singleton predicate instance */
- public static final Predicate<?> INSTANCE = new TruePredicate<Object>();
+ @SuppressWarnings("rawtypes")
+ public static final Predicate INSTANCE = new TruePredicate<Object>();
/**
* Factory returning the singleton instance.