Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5697AE27A for ; Mon, 7 Jan 2013 17:16:56 +0000 (UTC) Received: (qmail 53352 invoked by uid 500); 7 Jan 2013 17:16:56 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 53299 invoked by uid 500); 7 Jan 2013 17:16:56 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 53290 invoked by uid 99); 7 Jan 2013 17:16:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 17:16:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2013 17:16:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B279E2388B6C; Mon, 7 Jan 2013 17:15:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1429905 [7/26] - in /commons/proper/collections/trunk/src: main/java/org/apache/commons/collections/ main/java/org/apache/commons/collections/bag/ main/java/org/apache/commons/collections/bidimap/ main/java/org/apache/commons/collections/b... Date: Mon, 07 Jan 2013 17:15:24 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130107171546.B279E2388B6C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/FunctorUtils.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/FunctorUtils.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/FunctorUtils.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/FunctorUtils.java Mon Jan 7 17:15:14 2013 @@ -46,7 +46,7 @@ class FunctorUtils { * @return the cloned predicates */ @SuppressWarnings("unchecked") - static Predicate[] copy(Predicate[] predicates) { + static Predicate[] copy(final Predicate[] predicates) { if (predicates == null) { return null; } @@ -66,7 +66,7 @@ class FunctorUtils { * @return the coerced predicate. */ @SuppressWarnings("unchecked") - static Predicate coerce(Predicate predicate){ + static Predicate coerce(final Predicate predicate){ return (Predicate) predicate; } @@ -75,7 +75,7 @@ class FunctorUtils { * * @param predicates the predicates to validate */ - static void validate(Predicate[] predicates) { + static void validate(final Predicate[] predicates) { if (predicates == null) { throw new IllegalArgumentException("The predicate array must not be null"); } @@ -93,15 +93,16 @@ class FunctorUtils { * @param predicates the predicates to validate * @return predicate array */ - static Predicate[] validate(Collection> predicates) { + static Predicate[] validate(final Collection> predicates) { if (predicates == null) { throw new IllegalArgumentException("The predicate collection must not be null"); } // convert to array like this to guarantee iterator() ordering @SuppressWarnings("unchecked") // OK + final Predicate[] preds = new Predicate[predicates.size()]; int i = 0; - for (Predicate predicate : predicates) { + for (final Predicate predicate : predicates) { preds[i] = predicate; if (preds[i] == null) { throw new IllegalArgumentException("The predicate collection must not contain a null predicate, index " + i + " was null"); @@ -118,7 +119,7 @@ class FunctorUtils { * @return the cloned closures */ @SuppressWarnings("unchecked") - static Closure[] copy(Closure[] closures) { + static Closure[] copy(final Closure[] closures) { if (closures == null) { return null; } @@ -130,7 +131,7 @@ class FunctorUtils { * * @param closures the closures to validate */ - static void validate(Closure[] closures) { + static void validate(final Closure[] closures) { if (closures == null) { throw new IllegalArgumentException("The closure array must not be null"); } @@ -152,7 +153,7 @@ class FunctorUtils { * @return the coerced closure. */ @SuppressWarnings("unchecked") - static Closure coerce(Closure closure){ + static Closure coerce(final Closure closure){ return (Closure) closure; } @@ -163,7 +164,7 @@ class FunctorUtils { * @return a clone of the transformers */ @SuppressWarnings("unchecked") - static Transformer[] copy(Transformer[] transformers) { + static Transformer[] copy(final Transformer[] transformers) { if (transformers == null) { return null; } @@ -175,7 +176,7 @@ class FunctorUtils { * * @param transformers the transformers to validate */ - static void validate(Transformer[] transformers) { + static void validate(final Transformer[] transformers) { if (transformers == null) { throw new IllegalArgumentException("The transformer array must not be null"); } @@ -198,7 +199,7 @@ class FunctorUtils { * @return the coerced transformer. */ @SuppressWarnings("unchecked") - static Transformer coerce(Transformer transformer) { + static Transformer coerce(final Transformer transformer) { return (Transformer) transformer; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IdentityPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IdentityPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IdentityPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IdentityPredicate.java Mon Jan 7 17:15:14 2013 @@ -43,7 +43,7 @@ public final class IdentityPredicate * @return the predicate * @throws IllegalArgumentException if the predicate is null */ - public static Predicate identityPredicate(T object) { + public static Predicate identityPredicate(final T object) { if (object == null) { return NullPredicate.nullPredicate(); } @@ -56,7 +56,7 @@ public final class IdentityPredicate * * @param object the object to compare to */ - public IdentityPredicate(T object) { + public IdentityPredicate(final T object) { super(); iValue = object; } @@ -68,7 +68,7 @@ public final class IdentityPredicate * @param object the input object * @return true if input is the same object as the stored value */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return iValue == object; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IfClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IfClosure.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IfClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/IfClosure.java Mon Jan 7 17:15:14 2013 @@ -53,7 +53,7 @@ public class IfClosure implements Clo * @throws IllegalArgumentException if either argument is null * @since 3.2 */ - public static Closure ifClosure(Predicate predicate, Closure trueClosure) { + public static Closure ifClosure(final Predicate predicate, final Closure trueClosure) { return IfClosure.ifClosure(predicate, trueClosure, NOPClosure.nopClosure()); } @@ -67,9 +67,9 @@ public class IfClosure implements Clo * @return the if closure * @throws IllegalArgumentException if any argument is null */ - public static Closure ifClosure(Predicate predicate, - Closure trueClosure, - Closure falseClosure) { + public static Closure ifClosure(final Predicate predicate, + final Closure trueClosure, + final Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -90,7 +90,7 @@ public class IfClosure implements Clo * @param trueClosure closure used if true, not null * @since 3.2 */ - public IfClosure(Predicate predicate, Closure trueClosure) { + public IfClosure(final Predicate predicate, final Closure trueClosure) { this(predicate, trueClosure, NOPClosure.INSTANCE); } @@ -102,7 +102,7 @@ public class IfClosure implements Clo * @param trueClosure closure used if true, not null * @param falseClosure closure used if false, not null */ - public IfClosure(Predicate predicate, Closure trueClosure, Closure falseClosure) { + public IfClosure(final Predicate predicate, final Closure trueClosure, final Closure falseClosure) { super(); iPredicate = predicate; iTrueClosure = trueClosure; @@ -114,7 +114,7 @@ public class IfClosure implements Clo * * @param input the input object */ - public void execute(E input) { + public void execute(final E input) { if (iPredicate.evaluate(input)) { iTrueClosure.execute(input); } else { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstanceofPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstanceofPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstanceofPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstanceofPredicate.java Mon Jan 7 17:15:14 2013 @@ -42,7 +42,7 @@ public final class InstanceofPredicate i * @return the predicate * @throws IllegalArgumentException if the class is null */ - public static Predicate instanceOfPredicate(Class type) { + public static Predicate instanceOfPredicate(final Class type) { if (type == null) { throw new IllegalArgumentException("The type to check instanceof must not be null"); } @@ -55,7 +55,7 @@ public final class InstanceofPredicate i * * @param type the type to check for */ - public InstanceofPredicate(Class type) { + public InstanceofPredicate(final Class type) { super(); iType = type; } @@ -66,7 +66,7 @@ public final class InstanceofPredicate i * @param object the input object * @return true if input is of stored type */ - public boolean evaluate(Object object) { + public boolean evaluate(final Object object) { return iType.isInstance(object); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java Mon Jan 7 17:15:14 2013 @@ -51,7 +51,7 @@ public class InstantiateFactory imple * @param args the constructor arguments * @return a new instantiate factory */ - public static Factory instantiateFactory(Class classToInstantiate, Class[] paramTypes, Object[] args) { + public static Factory instantiateFactory(final Class classToInstantiate, Class[] paramTypes, Object[] args) { if (classToInstantiate == null) { throw new IllegalArgumentException("Class to instantiate must not be null"); } @@ -75,7 +75,7 @@ public class InstantiateFactory imple * * @param classToInstantiate the class to instantiate */ - public InstantiateFactory(Class classToInstantiate) { + public InstantiateFactory(final Class classToInstantiate) { super(); iClassToInstantiate = classToInstantiate; iParamTypes = null; @@ -91,7 +91,7 @@ public class InstantiateFactory imple * @param paramTypes the constructor parameter types, not cloned * @param args the constructor arguments, not cloned */ - public InstantiateFactory(Class classToInstantiate, Class[] paramTypes, Object[] args) { + public InstantiateFactory(final Class classToInstantiate, final Class[] paramTypes, final Object[] args) { super(); iClassToInstantiate = classToInstantiate; iParamTypes = paramTypes; @@ -106,7 +106,7 @@ public class InstantiateFactory imple try { iConstructor = iClassToInstantiate.getConstructor(iParamTypes); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { throw new IllegalArgumentException("InstantiateFactory: The constructor must exist and be public "); } } @@ -124,11 +124,11 @@ public class InstantiateFactory imple try { return iConstructor.newInstance(iArgs); - } catch (InstantiationException ex) { + } catch (final InstantiationException ex) { throw new FunctorException("InstantiateFactory: InstantiationException", ex); - } catch (IllegalAccessException ex) { + } catch (final IllegalAccessException ex) { throw new FunctorException("InstantiateFactory: Constructor must be public", ex); - } catch (InvocationTargetException ex) { + } catch (final InvocationTargetException ex) { throw new FunctorException("InstantiateFactory: Constructor threw an exception", ex); } } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InstantiateTransformer.java Mon Jan 7 17:15:14 2013 @@ -89,7 +89,7 @@ public class InstantiateTransformer i * @param paramTypes the constructor parameter types, not cloned * @param args the constructor arguments, not cloned */ - public InstantiateTransformer(Class[] paramTypes, Object[] args) { + public InstantiateTransformer(final Class[] paramTypes, final Object[] args) { super(); iParamTypes = paramTypes; iArgs = args; @@ -101,21 +101,21 @@ public class InstantiateTransformer i * @param input the input object to transform * @return the transformed result */ - public T transform(Class input) { + public T transform(final Class input) { try { if (input == null) { throw new FunctorException( "InstantiateTransformer: Input object was not an instanceof Class, it was a null object"); } - Constructor con = input.getConstructor(iParamTypes); + final Constructor con = input.getConstructor(iParamTypes); return con.newInstance(iArgs); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { throw new FunctorException("InstantiateTransformer: The constructor must exist and be public "); - } catch (InstantiationException ex) { + } catch (final InstantiationException ex) { throw new FunctorException("InstantiateTransformer: InstantiationException", ex); - } catch (IllegalAccessException ex) { + } catch (final IllegalAccessException ex) { throw new FunctorException("InstantiateTransformer: Constructor must be public", ex); - } catch (InvocationTargetException ex) { + } catch (final InvocationTargetException ex) { throw new FunctorException("InstantiateTransformer: Constructor threw an exception", ex); } } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InvokerTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InvokerTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InvokerTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/InvokerTransformer.java Mon Jan 7 17:15:14 2013 @@ -48,7 +48,7 @@ public class InvokerTransformer im * @return an invoker transformer * @since 3.1 */ - public static Transformer invokerTransformer(String methodName) { + public static Transformer invokerTransformer(final String methodName) { if (methodName == null) { throw new IllegalArgumentException("The method to invoke must not be null"); } @@ -63,7 +63,7 @@ public class InvokerTransformer im * @param args the arguments to pass to the method * @return an invoker transformer */ - public static Transformer invokerTransformer(String methodName, Class[] paramTypes, Object[] args) { + public static Transformer invokerTransformer(final String methodName, Class[] paramTypes, Object[] args) { if (methodName == null) { throw new IllegalArgumentException("The method to invoke must not be null"); } @@ -86,7 +86,7 @@ public class InvokerTransformer im * * @param methodName the method to call */ - private InvokerTransformer(String methodName) { + private InvokerTransformer(final String methodName) { super(); iMethodName = methodName; iParamTypes = null; @@ -101,7 +101,7 @@ public class InvokerTransformer im * @param paramTypes the constructor parameter types, not cloned * @param args the constructor arguments, not cloned */ - public InvokerTransformer(String methodName, Class[] paramTypes, Object[] args) { + public InvokerTransformer(final String methodName, final Class[] paramTypes, final Object[] args) { super(); iMethodName = methodName; iParamTypes = paramTypes; @@ -115,21 +115,21 @@ public class InvokerTransformer im * @return the transformed result, null if null input */ @SuppressWarnings("unchecked") - public O transform(Object input) { + public O transform(final Object input) { if (input == null) { return null; } try { - Class cls = input.getClass(); - Method method = cls.getMethod(iMethodName, iParamTypes); + final Class cls = input.getClass(); + final Method method = cls.getMethod(iMethodName, iParamTypes); return (O) method.invoke(input, iArgs); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" + input.getClass() + "' does not exist"); - } catch (IllegalAccessException ex) { + } catch (final IllegalAccessException ex) { throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" + input.getClass() + "' cannot be accessed"); - } catch (InvocationTargetException ex) { + } catch (final InvocationTargetException ex) { throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" + input.getClass() + "' threw an exception", ex); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/MapTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/MapTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/MapTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/MapTransformer.java Mon Jan 7 17:15:14 2013 @@ -44,7 +44,7 @@ public final class MapTransformer * @param map the map, not cloned * @return the transformer */ - public static Transformer mapTransformer(Map map) { + public static Transformer mapTransformer(final Map map) { if (map == null) { return ConstantTransformer.nullTransformer(); } @@ -57,7 +57,7 @@ public final class MapTransformer * * @param map the map to use for lookup, not cloned */ - private MapTransformer(Map map) { + private MapTransformer(final Map map) { super(); iMap = map; } @@ -68,7 +68,7 @@ public final class MapTransformer * @param input the input object to transform * @return the transformed result */ - public O transform(I input) { + public O transform(final I input) { return iMap.get(input); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPClosure.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPClosure.java Mon Jan 7 17:15:14 2013 @@ -58,7 +58,7 @@ public final class NOPClosure impleme * * @param input the input object */ - public void execute(E input) { + public void execute(final E input) { // do nothing } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NOPTransformer.java Mon Jan 7 17:15:14 2013 @@ -58,7 +58,7 @@ public class NOPTransformer implement * @param input the input object to transform * @return the transformed result which is the input */ - public T transform(T input) { + public T transform(final T input) { return input; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NonePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NonePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NonePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NonePredicate.java Mon Jan 7 17:15:14 2013 @@ -51,7 +51,7 @@ public final class NonePredicate impl * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ - public static Predicate nonePredicate(Predicate... predicates) { + public static Predicate nonePredicate(final Predicate... predicates) { FunctorUtils.validate(predicates); if (predicates.length == 0) { return TruePredicate.truePredicate(); @@ -70,8 +70,8 @@ public final class NonePredicate impl * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ - public static Predicate nonePredicate(Collection> predicates) { - Predicate[] preds = FunctorUtils.validate(predicates); + public static Predicate nonePredicate(final Collection> predicates) { + final Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.truePredicate(); } @@ -84,7 +84,7 @@ public final class NonePredicate impl * * @param predicates the predicates to check, not cloned, not null */ - public NonePredicate(Predicate[] predicates) { + public NonePredicate(final Predicate[] predicates) { super(); iPredicates = predicates; } @@ -95,8 +95,8 @@ public final class NonePredicate impl * @param object the input object * @return true if none of decorated predicates return true */ - public boolean evaluate(T object) { - for (Predicate iPredicate : iPredicates) { + public boolean evaluate(final T object) { + for (final Predicate iPredicate : iPredicates) { if (iPredicate.evaluate(object)) { return false; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotNullPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotNullPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotNullPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotNullPredicate.java Mon Jan 7 17:15:14 2013 @@ -59,7 +59,7 @@ public final class NotNullPredicate i * @param object the object to evaluate * @return true if not null */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return object != null; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NotPredicate.java Mon Jan 7 17:15:14 2013 @@ -42,7 +42,7 @@ public final class NotPredicate imple * @return the predicate * @throws IllegalArgumentException if the predicate is null */ - public static Predicate notPredicate(Predicate predicate) { + public static Predicate notPredicate(final Predicate predicate) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -55,7 +55,7 @@ public final class NotPredicate imple * * @param predicate the predicate to call after the null check */ - public NotPredicate(Predicate predicate) { + public NotPredicate(final Predicate predicate) { super(); iPredicate = predicate; } @@ -66,7 +66,7 @@ public final class NotPredicate imple * @param object the input object * @return true if predicate returns false */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return !iPredicate.evaluate(object); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsExceptionPredicate.java Mon Jan 7 17:15:14 2013 @@ -43,7 +43,7 @@ public final class NullIsExceptionPredic * @return the predicate * @throws IllegalArgumentException if the predicate is null */ - public static Predicate nullIsExceptionPredicate(Predicate predicate) { + public static Predicate nullIsExceptionPredicate(final Predicate predicate) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -56,7 +56,7 @@ public final class NullIsExceptionPredic * * @param predicate the predicate to call after the null check */ - public NullIsExceptionPredicate(Predicate predicate) { + public NullIsExceptionPredicate(final Predicate predicate) { super(); iPredicate = predicate; } @@ -69,7 +69,7 @@ public final class NullIsExceptionPredic * @return true if decorated predicate returns true * @throws FunctorException if input is null */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { if (object == null) { throw new FunctorException("Input Object must not be null"); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsFalsePredicate.java Mon Jan 7 17:15:14 2013 @@ -42,7 +42,7 @@ public final class NullIsFalsePredicate< * @return the predicate * @throws IllegalArgumentException if the predicate is null */ - public static Predicate nullIsFalsePredicate(Predicate predicate) { + public static Predicate nullIsFalsePredicate(final Predicate predicate) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -55,7 +55,7 @@ public final class NullIsFalsePredicate< * * @param predicate the predicate to call after the null check */ - public NullIsFalsePredicate(Predicate predicate) { + public NullIsFalsePredicate(final Predicate predicate) { super(); iPredicate = predicate; } @@ -67,7 +67,7 @@ public final class NullIsFalsePredicate< * @param object the input object * @return true if decorated predicate returns true, false if input is null */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { if (object == null) { return false; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsTruePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsTruePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsTruePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/NullIsTruePredicate.java Mon Jan 7 17:15:14 2013 @@ -42,7 +42,7 @@ public final class NullIsTruePredicate Predicate nullIsTruePredicate(Predicate predicate) { + public static Predicate nullIsTruePredicate(final Predicate predicate) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -55,7 +55,7 @@ public final class NullIsTruePredicate predicate) { + public NullIsTruePredicate(final Predicate predicate) { super(); iPredicate = predicate; } @@ -67,7 +67,7 @@ public final class NullIsTruePredicate impl * @param object the input object * @return true if input is null */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return object == null; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OnePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OnePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OnePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OnePredicate.java Mon Jan 7 17:15:14 2013 @@ -53,7 +53,7 @@ public final class OnePredicate imple * @throws IllegalArgumentException if any predicate in the array is null */ @SuppressWarnings("unchecked") - public static Predicate onePredicate(Predicate... predicates) { + public static Predicate onePredicate(final Predicate... predicates) { FunctorUtils.validate(predicates); if (predicates.length == 0) { return FalsePredicate.falsePredicate(); @@ -73,8 +73,8 @@ public final class OnePredicate imple * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ - public static Predicate onePredicate(Collection> predicates) { - Predicate[] preds = FunctorUtils.validate(predicates); + public static Predicate onePredicate(final Collection> predicates) { + final Predicate[] preds = FunctorUtils.validate(predicates); return new OnePredicate(preds); } @@ -84,7 +84,7 @@ public final class OnePredicate imple * * @param predicates the predicates to check, not cloned, not null */ - public OnePredicate(Predicate[] predicates) { + public OnePredicate(final Predicate[] predicates) { super(); iPredicates = predicates; } @@ -96,9 +96,9 @@ public final class OnePredicate imple * @param object the input object * @return true if only one decorated predicate returns true */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { boolean match = false; - for (Predicate iPredicate : iPredicates) { + for (final Predicate iPredicate : iPredicates) { if (iPredicate.evaluate(object)) { if (match) { return false; Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OrPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OrPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OrPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/OrPredicate.java Mon Jan 7 17:15:14 2013 @@ -45,7 +45,7 @@ public final class OrPredicate implem * @return the and predicate * @throws IllegalArgumentException if either predicate is null */ - public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { + public static Predicate orPredicate(final Predicate predicate1, final Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -59,7 +59,7 @@ public final class OrPredicate implem * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null */ - public OrPredicate(Predicate predicate1, Predicate predicate2) { + public OrPredicate(final Predicate predicate1, final Predicate predicate2) { super(); iPredicate1 = predicate1; iPredicate2 = predicate2; @@ -71,7 +71,7 @@ public final class OrPredicate implem * @param object the input object * @return true if either decorated predicate returns true */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return iPredicate1.evaluate(object) || iPredicate2.evaluate(object); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PredicateTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PredicateTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PredicateTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PredicateTransformer.java Mon Jan 7 17:15:14 2013 @@ -43,7 +43,7 @@ public class PredicateTransformer imp * @return the predicate transformer * @throws IllegalArgumentException if the predicate is null */ - public static Transformer predicateTransformer(Predicate predicate) { + public static Transformer predicateTransformer(final Predicate predicate) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -56,7 +56,7 @@ public class PredicateTransformer imp * * @param predicate the predicate to call, not null */ - public PredicateTransformer(Predicate predicate) { + public PredicateTransformer(final Predicate predicate) { super(); iPredicate = predicate; } @@ -67,7 +67,7 @@ public class PredicateTransformer imp * @param input the input object to transform * @return the transformed result */ - public Boolean transform(T input) { + public Boolean transform(final T input) { return Boolean.valueOf(iPredicate.evaluate(input)); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PrototypeFactory.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PrototypeFactory.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PrototypeFactory.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PrototypeFactory.java Mon Jan 7 17:15:14 2013 @@ -54,22 +54,22 @@ public class PrototypeFactory { * @throws IllegalArgumentException if the prototype cannot be cloned */ @SuppressWarnings("unchecked") - public static Factory prototypeFactory(T prototype) { + public static Factory prototypeFactory(final T prototype) { if (prototype == null) { return ConstantFactory.constantFactory(null); } try { - Method method = prototype.getClass().getMethod("clone", (Class[]) null); + final Method method = prototype.getClass().getMethod("clone", (Class[]) null); return new PrototypeCloneFactory(prototype, method); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { try { prototype.getClass().getConstructor(new Class[] { prototype.getClass() }); return new InstantiateFactory( (Class) prototype.getClass(), new Class[] { prototype.getClass() }, new Object[] { prototype }); - } catch (NoSuchMethodException ex2) { + } catch (final NoSuchMethodException ex2) { if (prototype instanceof Serializable) { return (Factory) new PrototypeSerializationFactory((Serializable) prototype); } @@ -104,7 +104,7 @@ public class PrototypeFactory { /** * Constructor to store prototype. */ - private PrototypeCloneFactory(T prototype, Method method) { + private PrototypeCloneFactory(final T prototype, final Method method) { super(); iPrototype = prototype; iCloneMethod = method; @@ -116,7 +116,7 @@ public class PrototypeFactory { private void findCloneMethod() { try { iCloneMethod = iPrototype.getClass().getMethod("clone", (Class[]) null); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { throw new IllegalArgumentException("PrototypeCloneFactory: The clone method must exist and be public "); } } @@ -135,9 +135,9 @@ public class PrototypeFactory { try { return (T) iCloneMethod.invoke(iPrototype, (Object[]) null); - } catch (IllegalAccessException ex) { + } catch (final IllegalAccessException ex) { throw new FunctorException("PrototypeCloneFactory: Clone method must be public", ex); - } catch (InvocationTargetException ex) { + } catch (final InvocationTargetException ex) { throw new FunctorException("PrototypeCloneFactory: Clone method threw an exception", ex); } } @@ -159,7 +159,7 @@ public class PrototypeFactory { /** * Constructor to store prototype */ - private PrototypeSerializationFactory(T prototype) { + private PrototypeSerializationFactory(final T prototype) { super(); iPrototype = prototype; } @@ -171,31 +171,31 @@ public class PrototypeFactory { */ @SuppressWarnings("unchecked") public T create() { - ByteArrayOutputStream baos = new ByteArrayOutputStream(512); + final ByteArrayOutputStream baos = new ByteArrayOutputStream(512); ByteArrayInputStream bais = null; try { - ObjectOutputStream out = new ObjectOutputStream(baos); + final ObjectOutputStream out = new ObjectOutputStream(baos); out.writeObject(iPrototype); bais = new ByteArrayInputStream(baos.toByteArray()); - ObjectInputStream in = new ObjectInputStream(bais); + final ObjectInputStream in = new ObjectInputStream(bais); return (T) in.readObject(); - } catch (ClassNotFoundException ex) { + } catch (final ClassNotFoundException ex) { throw new FunctorException(ex); - } catch (IOException ex) { + } catch (final IOException ex) { throw new FunctorException(ex); } finally { try { if (bais != null) { bais.close(); } - } catch (IOException ex) { + } catch (final IOException ex) { // ignore } try { baos.close(); - } catch (IOException ex) { + } catch (final IOException ex) { // ignore } } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/StringValueTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/StringValueTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/StringValueTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/StringValueTransformer.java Mon Jan 7 17:15:14 2013 @@ -59,7 +59,7 @@ public final class StringValueTransforme * @param input the input object to transform * @return the transformed result */ - public String transform(T input) { + public String transform(final T input) { return String.valueOf(input); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchClosure.java Mon Jan 7 17:15:14 2013 @@ -53,9 +53,9 @@ public class SwitchClosure implements * @throws IllegalArgumentException if any element in the array is null */ @SuppressWarnings("unchecked") - public static Closure switchClosure(Predicate[] predicates, - Closure[] closures, - Closure defaultClosure) { + public static Closure switchClosure(final Predicate[] predicates, + final Closure[] closures, + final Closure defaultClosure) { FunctorUtils.validate(predicates); FunctorUtils.validate(closures); if (predicates.length != closures.length) { @@ -86,20 +86,20 @@ public class SwitchClosure implements * @throws ClassCastException if the map elements are of the wrong type */ @SuppressWarnings("unchecked") - public static Closure switchClosure(Map, Closure> predicatesAndClosures) { + public static Closure switchClosure(final Map, Closure> predicatesAndClosures) { if (predicatesAndClosures == null) { throw new IllegalArgumentException("The predicate and closure map must not be null"); } // convert to array like this to guarantee iterator() ordering - Closure defaultClosure = predicatesAndClosures.remove(null); - int size = predicatesAndClosures.size(); + final Closure defaultClosure = predicatesAndClosures.remove(null); + final int size = predicatesAndClosures.size(); if (size == 0) { return (Closure) (defaultClosure == null ? NOPClosure.nopClosure() : defaultClosure); } - Closure[] closures = new Closure[size]; - Predicate[] preds = new Predicate[size]; + final Closure[] closures = new Closure[size]; + final Predicate[] preds = new Predicate[size]; int i = 0; - for (Map.Entry, Closure> entry : predicatesAndClosures.entrySet()) { + for (final Map.Entry, Closure> entry : predicatesAndClosures.entrySet()) { preds[i] = entry.getKey(); closures[i] = entry.getValue(); i++; @@ -116,8 +116,8 @@ public class SwitchClosure implements * @param defaultClosure the closure to use if no match, null means nop */ @SuppressWarnings("unchecked") - public SwitchClosure(Predicate[] predicates, Closure[] closures, - Closure defaultClosure) { + public SwitchClosure(final Predicate[] predicates, final Closure[] closures, + final Closure defaultClosure) { super(); iPredicates = predicates; iClosures = closures; @@ -129,7 +129,7 @@ public class SwitchClosure implements * * @param input the input object */ - public void execute(E input) { + public void execute(final E input) { for (int i = 0; i < iPredicates.length; i++) { if (iPredicates[i].evaluate(input) == true) { iClosures[i].execute(input); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/SwitchTransformer.java Mon Jan 7 17:15:14 2013 @@ -52,9 +52,9 @@ public class SwitchTransformer imp * @throws IllegalArgumentException if any element in the array is null */ @SuppressWarnings("unchecked") - public static Transformer switchTransformer(Predicate[] predicates, - Transformer[] transformers, - Transformer defaultTransformer) { + public static Transformer switchTransformer(final Predicate[] predicates, + final Transformer[] transformers, + final Transformer defaultTransformer) { FunctorUtils.validate(predicates); FunctorUtils.validate(transformers); if (predicates.length != transformers.length) { @@ -87,7 +87,7 @@ public class SwitchTransformer imp */ @SuppressWarnings("unchecked") public static Transformer switchTransformer( - Map, ? extends Transformer> predicatesAndTransformers) { + final Map, ? extends Transformer> predicatesAndTransformers) { if (predicatesAndTransformers == null) { throw new IllegalArgumentException("The predicate and transformer map must not be null"); } @@ -95,15 +95,15 @@ public class SwitchTransformer imp return ConstantTransformer.nullTransformer(); } // convert to array like this to guarantee iterator() ordering - Transformer defaultTransformer = predicatesAndTransformers.remove(null); - int size = predicatesAndTransformers.size(); + final Transformer defaultTransformer = predicatesAndTransformers.remove(null); + final int size = predicatesAndTransformers.size(); if (size == 0) { return (Transformer) (defaultTransformer == null ? ConstantTransformer.nullTransformer() : defaultTransformer); } - Transformer[] transformers = new Transformer[size]; - Predicate[] preds = new Predicate[size]; + final Transformer[] transformers = new Transformer[size]; + final Predicate[] preds = new Predicate[size]; int i = 0; - for (Map.Entry, ? extends Transformer> entry : predicatesAndTransformers.entrySet()) { + for (final Map.Entry, ? extends Transformer> entry : predicatesAndTransformers.entrySet()) { preds[i] = entry.getKey(); transformers[i] = entry.getValue(); i++; @@ -120,9 +120,9 @@ public class SwitchTransformer imp * @param defaultTransformer the transformer to use if no match, null means return null */ @SuppressWarnings("unchecked") - public SwitchTransformer(Predicate[] predicates, - Transformer[] transformers, - Transformer defaultTransformer) { + public SwitchTransformer(final Predicate[] predicates, + final Transformer[] transformers, + final Transformer defaultTransformer) { super(); iPredicates = predicates; iTransformers = transformers; @@ -136,7 +136,7 @@ public class SwitchTransformer imp * @param input the input object to transform * @return the transformed result */ - public O transform(I input) { + public O transform(final I input) { for (int i = 0; i < iPredicates.length; i++) { if (iPredicates[i].evaluate(input) == true) { return iTransformers[i].transform(input); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformedPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformedPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformedPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformedPredicate.java Mon Jan 7 17:15:14 2013 @@ -48,8 +48,8 @@ public final class TransformedPredicate< * @return the predicate * @throws IllegalArgumentException if the transformer or the predicate is null */ - public static Predicate transformedPredicate(Transformer transformer, - Predicate predicate) { + public static Predicate transformedPredicate(final Transformer transformer, + final Predicate predicate) { if (transformer == null) { throw new IllegalArgumentException("The transformer to call must not be null"); } @@ -66,7 +66,7 @@ public final class TransformedPredicate< * @param transformer the transformer to use * @param predicate the predicate to decorate */ - public TransformedPredicate(Transformer transformer, Predicate predicate) { + public TransformedPredicate(final Transformer transformer, final Predicate predicate) { iTransformer = transformer; iPredicate = predicate; } @@ -78,8 +78,8 @@ public final class TransformedPredicate< * @param object the input object which will be transformed * @return true if decorated predicate returns true */ - public boolean evaluate(T object) { - T result = iTransformer.transform(object); + public boolean evaluate(final T object) { + final T result = iTransformer.transform(object); return iPredicate.evaluate(result); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerClosure.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerClosure.java Mon Jan 7 17:15:14 2013 @@ -45,7 +45,7 @@ public class TransformerClosure imple * @param transformer the transformer to call, null means nop * @return the transformer closure */ - public static Closure transformerClosure(Transformer transformer) { + public static Closure transformerClosure(final Transformer transformer) { if (transformer == null) { return NOPClosure.nopClosure(); } @@ -58,7 +58,7 @@ public class TransformerClosure imple * * @param transformer the transformer to call, not null */ - public TransformerClosure(Transformer transformer) { + public TransformerClosure(final Transformer transformer) { super(); iTransformer = transformer; } @@ -68,7 +68,7 @@ public class TransformerClosure imple * * @param input the input object */ - public void execute(E input) { + public void execute(final E input) { iTransformer.transform(input); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerPredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerPredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TransformerPredicate.java Mon Jan 7 17:15:14 2013 @@ -44,7 +44,7 @@ public final class TransformerPredicate< * @return the predicate * @throws IllegalArgumentException if the transformer is null */ - public static Predicate transformerPredicate(Transformer transformer) { + public static Predicate transformerPredicate(final Transformer transformer) { if (transformer == null) { throw new IllegalArgumentException("The transformer to call must not be null"); } @@ -57,7 +57,7 @@ public final class TransformerPredicate< * * @param transformer the transformer to decorate */ - public TransformerPredicate(Transformer transformer) { + public TransformerPredicate(final Transformer transformer) { super(); iTransformer = transformer; } @@ -69,8 +69,8 @@ public final class TransformerPredicate< * @return true if decorated transformer returns Boolean.TRUE * @throws FunctorException if the transformer returns an invalid type */ - public boolean evaluate(T object) { - Boolean result = iTransformer.transform(object); + public boolean evaluate(final T object) { + final Boolean result = iTransformer.transform(object); if (result == null) { throw new FunctorException( "Transformer must return an instanceof Boolean, it was a null object"); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TruePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TruePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TruePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/TruePredicate.java Mon Jan 7 17:15:14 2013 @@ -59,7 +59,7 @@ public final class TruePredicate impl * @param object the input object * @return true always */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return true; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/UniquePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/UniquePredicate.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/UniquePredicate.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/UniquePredicate.java Mon Jan 7 17:15:14 2013 @@ -63,7 +63,7 @@ public final class UniquePredicate im * @param object the input object * @return true if this is the first time the object is seen */ - public boolean evaluate(T object) { + public boolean evaluate(final T object) { return iSet.add(object); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/WhileClosure.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/WhileClosure.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/WhileClosure.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/WhileClosure.java Mon Jan 7 17:15:14 2013 @@ -50,8 +50,8 @@ public class WhileClosure implements * @return the while closure * @throws IllegalArgumentException if the predicate or closure is null */ - public static Closure whileClosure(Predicate predicate, - Closure closure, boolean doLoop) { + public static Closure whileClosure(final Predicate predicate, + final Closure closure, final boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } @@ -69,7 +69,7 @@ public class WhileClosure implements * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once */ - public WhileClosure(Predicate predicate, Closure closure, boolean doLoop) { + public WhileClosure(final Predicate predicate, final Closure closure, final boolean doLoop) { super(); iPredicate = predicate; iClosure = closure; @@ -81,7 +81,7 @@ public class WhileClosure implements * * @param input the input object */ - public void execute(E input) { + public void execute(final E input) { if (iDoLoop) { iClosure.execute(input); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java Mon Jan 7 17:15:14 2013 @@ -57,11 +57,11 @@ abstract class AbstractEmptyIterator return -1; } - public void add(E obj) { + public void add(final E obj) { throw new UnsupportedOperationException("add() not supported for empty Iterator"); } - public void set(E obj) { + public void set(final E obj) { throw new IllegalStateException("Iterator contains no elements"); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyMapIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyMapIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyMapIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractEmptyMapIterator.java Mon Jan 7 17:15:14 2013 @@ -39,7 +39,7 @@ public abstract class AbstractEmptyMapIt throw new IllegalStateException("Iterator contains no elements"); } - public V setValue(V value) { + public V setValue(final V value) { throw new IllegalStateException("Iterator contains no elements"); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractIteratorDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractIteratorDecorator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractIteratorDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractIteratorDecorator.java Mon Jan 7 17:15:14 2013 @@ -35,7 +35,7 @@ public abstract class AbstractIteratorDe * @param iterator the iterator to decorate, must not be null * @throws IllegalArgumentException if the collection is null */ - protected AbstractIteratorDecorator(Iterator iterator) { + protected AbstractIteratorDecorator(final Iterator iterator) { super(iterator); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractListIteratorDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractListIteratorDecorator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractListIteratorDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractListIteratorDecorator.java Mon Jan 7 17:15:14 2013 @@ -38,7 +38,7 @@ public class AbstractListIteratorDecorat * @param iterator the iterator to decorate, must not be null * @throws IllegalArgumentException if the collection is null */ - public AbstractListIteratorDecorator(ListIterator iterator) { + public AbstractListIteratorDecorator(final ListIterator iterator) { super(); if (iterator == null) { throw new IllegalArgumentException("ListIterator must not be null"); @@ -93,12 +93,12 @@ public class AbstractListIteratorDecorat } /** {@inheritDoc} */ - public void set(E obj) { + public void set(final E obj) { iterator.set(obj); } /** {@inheritDoc} */ - public void add(E obj) { + public void add(final E obj) { iterator.add(obj); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractMapIteratorDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractMapIteratorDecorator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractMapIteratorDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractMapIteratorDecorator.java Mon Jan 7 17:15:14 2013 @@ -38,7 +38,7 @@ public class AbstractMapIteratorDecorato * @param iterator the iterator to decorate, must not be null * @throws IllegalArgumentException if the collection is null */ - public AbstractMapIteratorDecorator(MapIterator iterator) { + public AbstractMapIteratorDecorator(final MapIterator iterator) { super(); if (iterator == null) { throw new IllegalArgumentException("MapIterator must not be null"); @@ -83,7 +83,7 @@ public class AbstractMapIteratorDecorato } /** {@inheritDoc} */ - public V setValue(V obj) { + public V setValue(final V obj) { return iterator.setValue(obj); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractOrderedMapIteratorDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractOrderedMapIteratorDecorator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractOrderedMapIteratorDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractOrderedMapIteratorDecorator.java Mon Jan 7 17:15:14 2013 @@ -38,7 +38,7 @@ public class AbstractOrderedMapIteratorD * @param iterator the iterator to decorate, must not be null * @throws IllegalArgumentException if the collection is null */ - public AbstractOrderedMapIteratorDecorator(OrderedMapIterator iterator) { + public AbstractOrderedMapIteratorDecorator(final OrderedMapIterator iterator) { super(); if (iterator == null) { throw new IllegalArgumentException("OrderedMapIterator must not be null"); @@ -93,7 +93,7 @@ public class AbstractOrderedMapIteratorD } /** {@inheritDoc} */ - public V setValue(V obj) { + public V setValue(final V obj) { return iterator.setValue(obj); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractUntypedIteratorDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractUntypedIteratorDecorator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractUntypedIteratorDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/AbstractUntypedIteratorDecorator.java Mon Jan 7 17:15:14 2013 @@ -37,7 +37,7 @@ public abstract class AbstractUntypedIte * * @param iterator the iterator to decorate */ - protected AbstractUntypedIteratorDecorator(Iterator iterator) { + protected AbstractUntypedIteratorDecorator(final Iterator iterator) { super(); if (iterator == null) { throw new IllegalArgumentException("Iterator must not be null"); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/ArrayListIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/ArrayListIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/ArrayListIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/ArrayListIterator.java Mon Jan 7 17:15:14 2013 @@ -72,7 +72,7 @@ public class ArrayListIterator extend * @throws IllegalArgumentException if array is not an array. * @throws NullPointerException if array is null */ - public ArrayListIterator(Object array) { + public ArrayListIterator(final Object array) { super(array); } @@ -86,7 +86,7 @@ public class ArrayListIterator extend * @throws NullPointerException if array is null * @throws IndexOutOfBoundsException if the start index is out of bounds */ - public ArrayListIterator(Object array, int startIndex) { + public ArrayListIterator(final Object array, final int startIndex) { super(array, startIndex); this.startIndex = startIndex; } @@ -103,7 +103,7 @@ public class ArrayListIterator extend * @throws IllegalArgumentException if end index is before the start * @throws NullPointerException if array is null */ - public ArrayListIterator(Object array, int startIndex, int endIndex) { + public ArrayListIterator(final Object array, final int startIndex, final int endIndex) { super(array, startIndex, endIndex); this.startIndex = startIndex; } @@ -176,7 +176,7 @@ public class ArrayListIterator extend * @throws UnsupportedOperationException always thrown. * @see java.util.ListIterator#set */ - public void add(Object o) { + public void add(final Object o) { throw new UnsupportedOperationException("add() method is not supported"); } @@ -198,7 +198,7 @@ public class ArrayListIterator extend * before {@link #set(Object)} * @see java.util.ListIterator#set */ - public void set(Object o) { + public void set(final Object o) { if (this.lastItemIndex == -1) { throw new IllegalStateException("must call next() or previous() before a call to set()"); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/CollatingIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/CollatingIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/CollatingIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/CollatingIterator.java Mon Jan 7 17:15:14 2013 @@ -133,7 +133,7 @@ public class CollatingIterator implem */ public CollatingIterator(final Comparator comp, final Iterator[] iterators) { this(comp, iterators.length); - for (Iterator iterator : iterators) { + for (final Iterator iterator : iterators) { addIterator(iterator); } } @@ -154,7 +154,7 @@ public class CollatingIterator implem */ public CollatingIterator(final Comparator comp, final Collection> iterators) { this(comp, iterators.size()); - for (Iterator iterator : iterators) { + for (final Iterator iterator : iterators) { addIterator(iterator); } } @@ -248,11 +248,11 @@ public class CollatingIterator implem if (hasNext() == false) { throw new NoSuchElementException(); } - int leastIndex = least(); + final int leastIndex = least(); if (leastIndex == -1) { throw new NoSuchElementException(); } - E val = values.get(leastIndex); + final E val = values.get(leastIndex); clear(leastIndex); lastReturned = leastIndex; return val; @@ -310,8 +310,8 @@ public class CollatingIterator implem * * @return false iff there was no value to set */ - private boolean set(int i) { - Iterator it = iterators.get(i); + private boolean set(final int i) { + final Iterator it = iterators.get(i); if (it.hasNext()) { values.set(i, it.next()); valueSet.set(i); @@ -326,7 +326,7 @@ public class CollatingIterator implem * Clears the {@link #values} and {@link #valueSet} attributes at position * i. */ - private void clear(int i) { + private void clear(final int i) { values.set(i, null); valueSet.clear(i); } @@ -361,7 +361,7 @@ public class CollatingIterator implem leastIndex = i; leastObject = values.get(i); } else { - E curObject = values.get(i); + final E curObject = values.get(i); if (comparator == null) { throw new NullPointerException("You must invoke setComparator() to set a comparator first."); } @@ -379,7 +379,7 @@ public class CollatingIterator implem * Returns true iff any bit in the given set is * true. */ - private boolean anyValueSet(BitSet set) { + private boolean anyValueSet(final BitSet set) { for (int i = 0; i < set.size(); i++) { if (set.get(i)) { return true; @@ -392,8 +392,8 @@ public class CollatingIterator implem * Returns true iff any {@link Iterator} in the given list has * a next value. */ - private boolean anyHasNext(ArrayList> iters) { - for (Iterator iterator : iters) { + private boolean anyHasNext(final ArrayList> iters) { + for (final Iterator iterator : iters) { if (iterator.hasNext()) { return true; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/EntrySetMapIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/EntrySetMapIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/EntrySetMapIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/EntrySetMapIterator.java Mon Jan 7 17:15:14 2013 @@ -49,7 +49,7 @@ public class EntrySetMapIterator i * * @param map the map to iterate over */ - public EntrySetMapIterator(Map map) { + public EntrySetMapIterator(final Map map) { super(); this.map = map; this.iterator = map.entrySet().iterator(); @@ -136,7 +136,7 @@ public class EntrySetMapIterator i * @throws IllegalStateException if remove() has been called since the * last call to next() */ - public V setValue(V value) { + public V setValue(final V value) { if (last == null) { throw new IllegalStateException("Iterator setValue() can only be called after next() and before remove()"); } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/FilterIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/FilterIterator.java?rev=1429905&r1=1429904&r2=1429905&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/FilterIterator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/iterators/FilterIterator.java Mon Jan 7 17:15:14 2013 @@ -56,7 +56,7 @@ public class FilterIterator implement * * @param iterator the iterator to use */ - public FilterIterator(Iterator iterator) { + public FilterIterator(final Iterator iterator) { super(); this.iterator = iterator; } @@ -68,7 +68,7 @@ public class FilterIterator implement * @param iterator the iterator to use * @param predicate the predicate to use */ - public FilterIterator(Iterator iterator, Predicate predicate) { + public FilterIterator(final Iterator iterator, final Predicate predicate) { super(); this.iterator = iterator; this.predicate = predicate; @@ -138,7 +138,7 @@ public class FilterIterator implement * * @param iterator the iterator to use */ - public void setIterator(Iterator iterator) { + public void setIterator(final Iterator iterator) { this.iterator = iterator; nextObject = null; nextObjectSet = false; @@ -159,7 +159,7 @@ public class FilterIterator implement * * @param predicate the predicate to use */ - public void setPredicate(Predicate predicate) { + public void setPredicate(final Predicate predicate) { this.predicate = predicate; nextObject = null; nextObjectSet = false; @@ -172,7 +172,7 @@ public class FilterIterator implement */ private boolean setNextObject() { while (iterator.hasNext()) { - E object = iterator.next(); + final E object = iterator.next(); if (predicate.evaluate(object)) { nextObject = object; nextObjectSet = true;