Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java Sat Oct 26 17:55:27 2013 @@ -99,16 +99,14 @@ public final class BinaryOr<L, R> extend * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof BinaryOr<?, ?> && equals((BinaryOr<?, ?>) that)); - } - - /** - * Learn whether another BinaryOr is equal to this. - * @param that BinaryOr to test - * @return boolean - */ - public boolean equals(BinaryOr<?, ?> that) { + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BinaryOr<?, ?>)) { + return false; + } + BinaryOr<?, ?> that = (BinaryOr<?, ?>) obj; return getBinaryPredicateListEquals(that); }
Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java Sat Oct 26 17:55:27 2013 @@ -117,18 +117,15 @@ public class BinarySequence<L, R> implem * {@inheritDoc} */ @Override - public final boolean equals(Object that) { - return that == this || (that instanceof BinarySequence<?, ?> && equals((BinarySequence<?, ?>) that)); - } - - /** - * Learn whether another BinarySequence is equal to this. - * @param that BinarySequence to test - * @return boolean - */ - public final boolean equals(BinarySequence<?, ?> that) { - // by construction, list is never null - return null != that && list.equals(that.list); + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BinarySequence<?, ?>)) { + return false; + } + BinarySequence<?, ?> that = (BinarySequence<?, ?>) obj; + return this.list.equals(that.list); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryFunction.java Sat Oct 26 17:55:27 2013 @@ -137,21 +137,17 @@ public class CompositeBinaryFunction<L, * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof CompositeBinaryFunction<?, ?, ?> - && equals((CompositeBinaryFunction<?, ?, ?>) that)); - } - - /** - * Learn whether a given CompositeBinaryFunction is equal to this. - * @param that CompositeBinaryFunction to test - * @return boolean - */ - public boolean equals(CompositeBinaryFunction<?, ?, ?> that) { - return null != that - && helper.f.equals(that.helper.f) - && helper.g.equals(that.helper.g) - && helper.h.equals(that.helper.h); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof CompositeBinaryFunction<?, ?, ?>)) { + return false; + } + CompositeBinaryFunction<?, ?, ?> that = (CompositeBinaryFunction<?, ?, ?>) obj; + return this.helper.f.equals(that.helper.f) + && this.helper.g.equals(that.helper.g) + && this.helper.h.equals(that.helper.h); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryPredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryPredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeBinaryPredicate.java Sat Oct 26 17:55:27 2013 @@ -136,19 +136,17 @@ public class CompositeBinaryPredicate<L, * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof CompositeBinaryPredicate<?, ?> - && equals((CompositeBinaryPredicate<?, ?>) that)); - } - - /** - * Learn whether another CompositeBinaryPredicate is equal to this. - * @param that CompositeBinaryPredicate to test - * @return boolean - */ - public boolean equals(CompositeBinaryPredicate<?, ?> that) { - return null != that && helper.f.equals(that.helper.f) && helper.g.equals(that.helper.g) - && helper.h.equals(that.helper.h); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof CompositeBinaryPredicate<?, ?>)) { + return false; + } + CompositeBinaryPredicate<?, ?> that = (CompositeBinaryPredicate<?, ?>) obj; + return this.helper.f.equals(that.helper.f) + && this.helper.g.equals(that.helper.g) + && this.helper.h.equals(that.helper.h); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeFunction.java Sat Oct 26 17:55:27 2013 @@ -184,19 +184,15 @@ public class CompositeFunction<A, T> imp * {@inheritDoc} */ @Override - public final boolean equals(Object that) { - return that == this - || (that instanceof CompositeFunction<?, ?> && equals((CompositeFunction<?, ?>) that)); - } - - /** - * Learn whether another CompositeFunction is equal to this. - * @param that CompositeFunction to test - * @return boolean - */ - public final boolean equals(CompositeFunction<?, ?> that) { - // by construction, list is never null - return null != that && function.equals(that.function); + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof CompositeFunction<?, ?>)) { + return false; + } + CompositeFunction<?, ?> that = (CompositeFunction<?, ?>) obj; + return this.function.equals(that.function); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositePredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositePredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositePredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositePredicate.java Sat Oct 26 17:55:27 2013 @@ -104,18 +104,15 @@ public final class CompositePredicate<A> * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof CompositePredicate<?> - && equals((CompositePredicate<?>) that)); - } - - /** - * Learn whether another CompositePredicate is equal to this. - * @param that CompositePredicate to test - * @return boolean - */ - public boolean equals(CompositePredicate<?> that) { - return null != that && function.equals(that.function); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof CompositePredicate<?>)) { + return false; + } + CompositePredicate<?> that = (CompositePredicate<?>) obj; + return this.function.equals(that.function); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/CompositeProcedure.java Sat Oct 26 17:55:27 2013 @@ -104,18 +104,15 @@ public final class CompositeProcedure<A> * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof CompositeProcedure<?> - && equals((CompositeProcedure<?>) that)); - } - - /** - * Learn whether another CompositeProcedure is equal to this. - * @param that CompositeProcedure to test - * @return boolean - */ - public boolean equals(CompositeProcedure<?> that) { - return null != that && function.equals(that.function); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof CompositeProcedure<?>)) { + return false; + } + CompositeProcedure<?> that = (CompositeProcedure<?>) obj; + return this.function.equals(that.function); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java Sat Oct 26 17:55:27 2013 @@ -100,21 +100,17 @@ public final class ConditionalBinaryFunc * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalBinaryFunction<?, ?, ?> - && equals((ConditionalBinaryFunction<?, ?, ?>) that)); - } - - /** - * Learn whether another ConditionalBinaryFunction is equal to this. - * @param that ConditionalBinaryFunction to test - * @return boolean - */ - public boolean equals(ConditionalBinaryFunction<?, ?, ?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenFunc.equals(that.thenFunc) - && elseFunc.equals(that.elseFunc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalBinaryFunction<?, ?, ?>)) { + return false; + } + ConditionalBinaryFunction<?, ?, ?> that = (ConditionalBinaryFunction<?, ?, ?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenFunc.equals(that.thenFunc) + && this.elseFunc.equals(that.elseFunc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java Sat Oct 26 17:55:27 2013 @@ -93,21 +93,17 @@ public final class ConditionalBinaryPred * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalBinaryPredicate<?, ?> - && equals((ConditionalBinaryPredicate<?, ?>) that)); - } - - /** - * Learn whether another ConditionalBinaryPredicate is equal to this. - * @param that ConditionalBinaryPredicate to test - * @return boolean - */ - public boolean equals(ConditionalBinaryPredicate<?, ?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenPred.equals(that.thenPred) - && elsePred.equals(that.elsePred); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalBinaryPredicate<?, ?>)) { + return false; + } + ConditionalBinaryPredicate<?, ?> that = (ConditionalBinaryPredicate<?, ?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenPred.equals(that.thenPred) + && this.elsePred.equals(that.elsePred); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java Sat Oct 26 17:55:27 2013 @@ -111,21 +111,17 @@ public final class ConditionalBinaryProc * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalBinaryProcedure<?, ?> - && equals((ConditionalBinaryProcedure<?, ?>) that)); - } - - /** - * Learn whether a given ConditionalBinaryProcedure is equal to this. - * @param that compared object - * @return boolean - */ - public boolean equals(ConditionalBinaryProcedure<?, ?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenProc.equals(that.thenProc) - && elseProc.equals(that.elseProc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalBinaryProcedure<?, ?>)) { + return false; + } + ConditionalBinaryProcedure<?, ?> that = (ConditionalBinaryProcedure<?, ?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenProc.equals(that.thenProc) + && this.elseProc.equals(that.elseProc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java Sat Oct 26 17:55:27 2013 @@ -98,21 +98,17 @@ public final class ConditionalFunction<A * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalFunction<?, ?> - && equals((ConditionalFunction<?, ?>) that)); - } - - /** - * Learn whether another ConditionalFunction is equal to this. - * @param that ConditionalFunction to test - * @return boolean - */ - public boolean equals(ConditionalFunction<?, ?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenFunc.equals(that.thenFunc) - && elseFunc.equals(that.elseFunc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalFunction<?, ?>)) { + return false; + } + ConditionalFunction<?, ?> that = (ConditionalFunction<?, ?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenFunc.equals(that.thenFunc) + && this.elseFunc.equals(that.elseFunc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryFunction.java Sat Oct 26 17:55:27 2013 @@ -97,21 +97,17 @@ public final class ConditionalNullaryFun * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalNullaryFunction<?> - && equals((ConditionalNullaryFunction<?>) that)); - } - - /** - * Learn whether another ConditionalNullaryFunction is equal to this. - * @param that ConditionalNullaryFunction to test - * @return boolean - */ - public boolean equals(ConditionalNullaryFunction<?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenFunc.equals(that.thenFunc) - && elseFunc.equals(that.elseFunc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalNullaryFunction<?>)) { + return false; + } + ConditionalNullaryFunction<?> that = (ConditionalNullaryFunction<?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenFunc.equals(that.thenFunc) + && this.elseFunc.equals(that.elseFunc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryPredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryPredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryPredicate.java Sat Oct 26 17:55:27 2013 @@ -90,21 +90,17 @@ public final class ConditionalNullaryPre * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalNullaryPredicate - && equals((ConditionalNullaryPredicate) that)); - } - - /** - * Learn whether another ConditionalNullaryPredicate is equal to this. - * @param that ConditionalNullaryPredicate to test - * @return boolean - */ - public boolean equals(ConditionalNullaryPredicate that) { - return null != that - && ifPred.equals(that.ifPred) - && thenPred.equals(that.thenPred) - && elsePred.equals(that.elsePred); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalNullaryPredicate)) { + return false; + } + ConditionalNullaryPredicate that = (ConditionalNullaryPredicate) obj; + return this.ifPred.equals(that.ifPred) + && this.thenPred.equals(that.thenPred) + && this.elsePred.equals(that.elsePred); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalNullaryProcedure.java Sat Oct 26 17:55:27 2013 @@ -105,21 +105,17 @@ public final class ConditionalNullaryPro * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalNullaryProcedure - && equals((ConditionalNullaryProcedure) that)); - } - - /** - * Learn whether another ConditionalProcecure is equal to this. - * @param that the ConditionalNullaryProcedure to test - * @return boolean - */ - public boolean equals(ConditionalNullaryProcedure that) { - return null != that - && ifPred.equals(that.ifPred) - && thenProc.equals(that.thenProc) - && elseProc.equals(that.elseProc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalNullaryProcedure)) { + return false; + } + ConditionalNullaryProcedure that = (ConditionalNullaryProcedure) obj; + return this.ifPred.equals(that.ifPred) + && this.thenProc.equals(that.thenProc) + && this.elseProc.equals(that.elseProc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java Sat Oct 26 17:55:27 2013 @@ -92,21 +92,17 @@ public final class ConditionalPredicate< * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalPredicate<?> - && equals((ConditionalPredicate<?>) that)); - } - - /** - * Learn whether another ConditionalPredicate is equal to this. - * @param that ConditionalPredicate to test - * @return boolean - */ - public boolean equals(ConditionalPredicate<?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenPred.equals(that.thenPred) - && elsePred.equals(that.elsePred); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalPredicate<?>)) { + return false; + } + ConditionalPredicate<?> that = (ConditionalPredicate<?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenPred.equals(that.thenPred) + && this.elsePred.equals(that.elsePred); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java Sat Oct 26 17:55:27 2013 @@ -107,21 +107,17 @@ public final class ConditionalProcedure< * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof ConditionalProcedure<?> - && equals((ConditionalProcedure<?>) that)); - } - - /** - * Learn whether another ConditionalProcedure is equal to this. - * @param that ConditionalProcedure to test - * @return boolean - */ - public boolean equals(ConditionalProcedure<?> that) { - return null != that - && ifPred.equals(that.ifPred) - && thenProc.equals(that.thenProc) - && elseProc.equals(that.elseProc); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ConditionalProcedure<?>)) { + return false; + } + ConditionalProcedure<?> that = (ConditionalProcedure<?>) obj; + return this.ifPred.equals(that.ifPred) + && this.thenProc.equals(that.thenProc) + && this.elseProc.equals(that.elseProc); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Not.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Not.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Not.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Not.java Sat Oct 26 17:55:27 2013 @@ -70,17 +70,15 @@ public final class Not<A> implements Pre * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof Not<?> && equals((Not<?>) that)); - } - - /** - * Learn whether another Not is equal to this. - * @param that Not to test - * @return boolean - */ - public boolean equals(Not<?> that) { - return null != that && predicate.equals(that.predicate); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Not<?>)) { + return false; + } + Not<?> that = (Not<?>) obj; + return this.predicate.equals(that.predicate); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryAnd.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryAnd.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryAnd.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryAnd.java Sat Oct 26 17:55:27 2013 @@ -98,16 +98,14 @@ public final class NullaryAnd extends Ba * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof NullaryAnd && equals((NullaryAnd) that)); - } - - /** - * Learn whether a given And is equal to this. - * @param that the And to test - * @return boolean - */ - public boolean equals(NullaryAnd that) { + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof NullaryAnd)) { + return false; + } + NullaryAnd that = (NullaryAnd) obj; return getNullaryPredicateListEquals(that); } Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryNot.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryNot.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryNot.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryNot.java Sat Oct 26 17:55:27 2013 @@ -70,17 +70,15 @@ public final class NullaryNot implements * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof NullaryNot && equals((NullaryNot) that)); - } - - /** - * Learn whether another NullaryNot is equal to this. - * @param that the NullaryNot to test - * @return boolean - */ - public boolean equals(NullaryNot that) { - return null != that && predicate.equals(that.predicate); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof NullaryNot)) { + return false; + } + NullaryNot that = (NullaryNot) obj; + return this.predicate.equals(that.predicate); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryOr.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryOr.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryOr.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullaryOr.java Sat Oct 26 17:55:27 2013 @@ -95,16 +95,14 @@ public final class NullaryOr extends Bas * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof NullaryOr && equals((NullaryOr) that)); - } - - /** - * Learn whether another NullaryOr is equal to this. - * @param that NullaryOr to test - * @return boolean - */ - public boolean equals(NullaryOr that) { + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof NullaryOr)) { + return false; + } + NullaryOr that = (NullaryOr) obj; return getNullaryPredicateListEquals(that); } Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullarySequence.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullarySequence.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullarySequence.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/NullarySequence.java Sat Oct 26 17:55:27 2013 @@ -118,18 +118,15 @@ public class NullarySequence implements * {@inheritDoc} */ @Override - public final boolean equals(Object that) { - return that == this || (that instanceof NullarySequence && equals((NullarySequence) that)); - } - - /** - * Learn whether a given NullarySequence is equal to this. - * @param that NullarySequence to test - * @return boolean - */ - public boolean equals(NullarySequence that) { - // by construction, list is never null - return null != that && list.equals(that.list); + public final boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NullarySequence)) { + return false; + } + NullarySequence that = (NullarySequence) obj; + return this.list.equals(that.list); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Or.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Or.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Or.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Or.java Sat Oct 26 17:55:27 2013 @@ -98,16 +98,14 @@ public final class Or<A> extends BasePre * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof Or<?> && equals((Or<?>) that)); - } - - /** - * Learn whether another Or is equal to this. - * @param that Or to test - * @return boolean - */ - public boolean equals(Or<?> that) { + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Or<?>)) { + return false; + } + Or<?> that = (Or<?>) obj; return getPredicateListEquals(that); } Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Sequence.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Sequence.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Sequence.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/Sequence.java Sat Oct 26 17:55:27 2013 @@ -119,18 +119,15 @@ public class Sequence<A> implements Proc * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof Sequence<?> && equals((Sequence<?>) that)); - } - - /** - * Learn whether another Sequence is equal to this. - * @param that Sequence to test - * @return boolean - */ - public boolean equals(Sequence<?> that) { - // by construction, list is never null - return null != that && list.equals(that.list); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Sequence<?>)) { + return false; + } + Sequence<?> that = (Sequence<?>) obj; + return this.list.equals(that.list); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryFunction.java Sat Oct 26 17:55:27 2013 @@ -102,18 +102,15 @@ public class TransformedBinaryFunction<L */ @Override public final boolean equals(Object obj) { - return obj == this || obj instanceof TransformedBinaryFunction<?, ?, ?> - && equals((TransformedBinaryFunction<?, ?, ?>) obj); - } - - /** - * Learn whether another TransformedBinaryFunction is equal to <code>this</code>. - * @param that instance to test - * @return whether equal - */ - public final boolean equals(TransformedBinaryFunction<?, ?, ?> that) { - return that != null && that.helper.preceding.equals(this.helper.preceding) - && that.helper.following.equals(this.helper.following); + if (obj == this) { + return true; + } + if (!(obj instanceof TransformedBinaryFunction<?, ?, ?>)) { + return false; + } + TransformedBinaryFunction<?, ?, ?> that = (TransformedBinaryFunction<?, ?, ?>) obj; + return this.helper.preceding.equals(that.helper.preceding) + && this.helper.following.equals(that.helper.following); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java Sat Oct 26 17:55:27 2013 @@ -102,18 +102,15 @@ public class TransformedBinaryProcedure< */ @Override public final boolean equals(Object obj) { - return obj == this || obj instanceof TransformedBinaryProcedure<?, ?> - && equals((TransformedBinaryProcedure<?, ?>) obj); - } - - /** - * Learn whether another TransformedBinaryProcedure is equal to <code>this</code>. - * @param that instance to test - * @return whether equal - */ - public final boolean equals(TransformedBinaryProcedure<?, ?> that) { - return that != null && that.helper.function.equals(this.helper.function) - && that.helper.procedure.equals(this.helper.procedure); + if (obj == this) { + return true; + } + if (!(obj instanceof TransformedBinaryProcedure<?, ?>)) { + return false; + } + TransformedBinaryProcedure<?, ?> that = (TransformedBinaryProcedure<?, ?>) obj; + return this.helper.function.equals(that.helper.function) + && this.helper.procedure.equals(that.helper.procedure); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryFunction.java Sat Oct 26 17:55:27 2013 @@ -99,18 +99,15 @@ public class TransformedNullaryFunction< */ @Override public final boolean equals(Object obj) { - return obj == this || obj instanceof TransformedNullaryFunction<?> - && equals((TransformedNullaryFunction<?>) obj); - } - - /** - * Learn whether another TransformedNullaryFunction is equal to <code>this</code>. - * @param that instance to test - * @return whether equal - */ - public final boolean equals(TransformedNullaryFunction<?> that) { - return that != null && that.helper.preceding.equals(this.helper.preceding) - && that.helper.following.equals(this.helper.following); + if (obj == this) { + return true; + } + if (!(obj instanceof TransformedNullaryFunction<?>)) { + return false; + } + TransformedNullaryFunction<?> that = (TransformedNullaryFunction<?>) obj; + return this.helper.preceding.equals(that.helper.preceding) + && this.helper.following.equals(that.helper.following); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransformedNullaryProcedure.java Sat Oct 26 17:55:27 2013 @@ -99,18 +99,15 @@ public class TransformedNullaryProcedure */ @Override public final boolean equals(Object obj) { - return obj == this || obj instanceof TransformedNullaryProcedure - && equals((TransformedNullaryProcedure) obj); - } - - /** - * Learn whether another TransformedNullaryProcedure is equal to <code>this</code>. - * @param that instance to test - * @return whether equal - */ - public final boolean equals(TransformedNullaryProcedure that) { - return that != null && that.helper.function.equals(this.helper.function) - && that.helper.procedure.equals(this.helper.procedure); + if (obj == this) { + return true; + } + if (!(obj instanceof TransformedNullaryProcedure)) { + return false; + } + TransformedNullaryProcedure that = (TransformedNullaryProcedure) obj; + return this.helper.function.equals(that.helper.function) + && this.helper.procedure.equals(that.helper.procedure); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java Sat Oct 26 17:55:27 2013 @@ -78,18 +78,15 @@ public class TransposedFunction<L, R, T> * {@inheritDoc} */ @Override - public final boolean equals(Object that) { - return that == this || (that instanceof TransposedFunction<?, ?, ?> - && equals((TransposedFunction<?, ?, ?>) that)); - } - - /** - * Learn whether another TransposedFunction is equal to this. - * @param that TransposedFunction to test - * @return boolean - */ - public final boolean equals(TransposedFunction<?, ?, ?> that) { - return null != that && function.equals(that.function); + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof TransposedFunction<?, ?, ?>)) { + return false; + } + TransposedFunction<?, ?, ?> that = (TransposedFunction<?, ?, ?>) obj; + return this.function.equals(that.function); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java Sat Oct 26 17:55:27 2013 @@ -76,17 +76,15 @@ public class TransposedPredicate<L, R> i * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof TransposedPredicate<?, ?> && equals((TransposedPredicate<?, ?>) that)); - } - - /** - * Learn whether another TransposedPredicate is equal to this. - * @param that the TransposedPredicate to test - * @return boolean - */ - public boolean equals(TransposedPredicate<?, ?> that) { - return null != that && predicate.equals(that.predicate); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof TransposedPredicate<?, ?>)) { + return false; + } + TransposedPredicate<?, ?> that = (TransposedPredicate<?, ?>) obj; + return this.predicate.equals(that.predicate); } /** Modified: commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java?rev=1536009&r1=1536008&r2=1536009&view=diff ============================================================================== --- commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java (original) +++ commons/proper/functor/trunk/core/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java Sat Oct 26 17:55:27 2013 @@ -76,17 +76,15 @@ public class TransposedProcedure<L, R> i * {@inheritDoc} */ @Override - public boolean equals(Object that) { - return that == this || (that instanceof TransposedProcedure<?, ?> && equals((TransposedProcedure<?, ?>) that)); - } - - /** - * Learn whether another TransposedProcedure is equal to this. - * @param that TransposedPredicate to test - * @return boolean - */ - public boolean equals(TransposedProcedure<?, ?> that) { - return null != that && procedure.equals(that.procedure); + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof TransposedProcedure<?, ?>)) { + return false; + } + TransposedProcedure<?, ?> that = (TransposedProcedure<?, ?>) obj; + return this.procedure.equals(that.procedure); } /**