You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2008/04/09 21:57:18 UTC
svn commit: r646506 [1/2] - in
/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor:
adapter/ core/ core/comparator/ core/composite/ generator/util/
Author: mbenson
Date: Wed Apr 9 12:56:50 2008
New Revision: 646506
URL: http://svn.apache.org/viewvc?rev=646506&view=rev
Log:
add/refactor == check in equals
Modified:
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Limit.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnarySequence.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -67,11 +67,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryFunctionBinaryPredicate) {
- return equals((BinaryFunctionBinaryPredicate) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof BinaryFunctionBinaryPredicate && equals((BinaryFunctionBinaryPredicate) that));
}
/**
@@ -80,8 +77,7 @@
* @return boolean
*/
public boolean equals(BinaryFunctionBinaryPredicate that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -64,11 +64,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryFunctionBinaryProcedure) {
- return equals((BinaryFunctionBinaryProcedure) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof BinaryFunctionBinaryProcedure && equals((BinaryFunctionBinaryProcedure) that));
}
/**
@@ -77,8 +74,7 @@
* @return boolean
*/
public boolean equals(BinaryFunctionBinaryProcedure that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryPredicateBinaryFunction) {
- return equals((BinaryPredicateBinaryFunction) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof BinaryPredicateBinaryFunction && equals((BinaryPredicateBinaryFunction) that));
}
/**
@@ -78,8 +75,7 @@
* @return boolean
*/
public boolean equals(BinaryPredicateBinaryFunction that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java Wed Apr 9 12:56:50 2008
@@ -62,11 +62,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryProcedureBinaryFunction) {
- return equals((BinaryProcedureBinaryFunction) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof BinaryProcedureBinaryFunction && equals((BinaryProcedureBinaryFunction) that));
}
/**
@@ -75,8 +72,7 @@
* @return boolean
*/
public boolean equals(BinaryProcedureBinaryFunction that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BoundFunction) {
- return equals((BoundFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BoundFunction && equals((BoundFunction) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(BoundFunction that) {
- return that == this || ((null != that)
+ return null != that
&& (null == function ? null == that.function : function.equals(that.function))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BoundPredicate) {
- return equals((BoundPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BoundPredicate && equals((BoundPredicate) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(BoundPredicate that) {
- return that == this || ((null != that)
+ return null != that
&& (null == predicate ? null == that.predicate : predicate.equals(that.predicate))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BoundProcedure) {
- return equals((BoundProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BoundProcedure && equals((BoundProcedure) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(BoundProcedure that) {
- return that == this || ((null != that)
+ return null != that
&& (null == procedure ? null == that.procedure : procedure.equals(that.procedure))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof FunctionPredicate) {
- return equals((FunctionPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof FunctionPredicate && equals((FunctionPredicate) that));
}
/**
@@ -78,8 +74,7 @@
* @return boolean
*/
public boolean equals(FunctionPredicate that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java Wed Apr 9 12:56:50 2008
@@ -63,11 +63,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof FunctionProcedure) {
- return equals((FunctionProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof FunctionProcedure && equals((FunctionProcedure) that));
}
/**
@@ -76,8 +72,7 @@
* @return boolean
*/
public boolean equals(FunctionProcedure that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof FunctionUnaryFunction) {
- return equals((FunctionUnaryFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof FunctionUnaryFunction && equals((FunctionUnaryFunction) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(FunctionUnaryFunction that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftFunction.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreLeftFunction) {
- return equals((IgnoreLeftFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreLeftFunction && equals((IgnoreLeftFunction) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreLeftFunction that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreLeftPredicate) {
- return equals((IgnoreLeftPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreLeftPredicate && equals((IgnoreLeftPredicate) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreLeftPredicate that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreLeftProcedure) {
- return equals((IgnoreLeftProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreLeftProcedure && equals((IgnoreLeftProcedure) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreLeftProcedure that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightFunction.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreRightFunction) {
- return equals((IgnoreRightFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreRightFunction && equals((IgnoreRightFunction) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreRightFunction that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreRightPredicate) {
- return equals((IgnoreRightPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreRightPredicate && equals((IgnoreRightPredicate) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreRightPredicate that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IgnoreRightProcedure) {
- return equals((IgnoreRightProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IgnoreRightProcedure && equals((IgnoreRightProcedure) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(IgnoreRightProcedure that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof LeftBoundFunction) {
- return equals((LeftBoundFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof LeftBoundFunction && equals((LeftBoundFunction) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(LeftBoundFunction that) {
- return that == this || ((null != that)
+ return null != that
&& (null == function ? null == that.function : function.equals(that.function))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java Wed Apr 9 12:56:50 2008
@@ -66,11 +66,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof LeftBoundPredicate) {
- return equals((LeftBoundPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof LeftBoundPredicate && equals((LeftBoundPredicate) that));
}
/**
@@ -79,9 +75,9 @@
* @return boolean
*/
public boolean equals(LeftBoundPredicate that) {
- return that == this || ((null != that)
+ return null != that
&& (null == predicate ? null == that.predicate : predicate.equals(that.predicate))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof LeftBoundProcedure) {
- return equals((LeftBoundProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof LeftBoundProcedure && equals((LeftBoundProcedure) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(LeftBoundProcedure that) {
- return that == this || ((null != that)
+ return null != that
&& (null == procedure ? null == that.procedure : procedure.equals(that.procedure))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof PredicateFunction) {
- return equals((PredicateFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof PredicateFunction && equals((PredicateFunction) that));
}
/**
@@ -78,8 +74,7 @@
* @return boolean
*/
public boolean equals(PredicateFunction that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateUnaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof PredicateUnaryPredicate) {
- return equals((PredicateUnaryPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof PredicateUnaryPredicate && equals((PredicateUnaryPredicate) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(PredicateUnaryPredicate that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java Wed Apr 9 12:56:50 2008
@@ -62,11 +62,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ProcedureFunction) {
- return equals((ProcedureFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ProcedureFunction && equals((ProcedureFunction) that));
}
/**
@@ -75,8 +71,7 @@
* @return boolean
*/
public boolean equals(ProcedureFunction that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -61,11 +61,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ProcedureUnaryProcedure) {
- return equals((ProcedureUnaryProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ProcedureUnaryProcedure && equals((ProcedureUnaryProcedure) that));
}
/**
@@ -74,8 +70,7 @@
* @return boolean
*/
public boolean equals(ProcedureUnaryProcedure that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java Wed Apr 9 12:56:50 2008
@@ -64,11 +64,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof RightBoundFunction) {
- return equals((RightBoundFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof RightBoundFunction && equals((RightBoundFunction) that));
}
/**
@@ -77,9 +73,9 @@
* @return boolean
*/
public boolean equals(RightBoundFunction that) {
- return that == this || ((null != that)
+ return null != that
&& (null == function ? null == that.function : function.equals(that.function))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof RightBoundPredicate) {
- return equals((RightBoundPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof RightBoundPredicate && equals((RightBoundPredicate) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(RightBoundPredicate that) {
- return that == this || ((null != that)
+ return null != that
&& (null == predicate ? null == that.predicate : predicate.equals(that.predicate))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof RightBoundProcedure) {
- return equals((RightBoundProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof RightBoundProcedure && equals((RightBoundProcedure) that));
}
/**
@@ -78,9 +74,9 @@
* @return boolean
*/
public boolean equals(RightBoundProcedure that) {
- return that == this || ((null != that)
+ return null != that
&& (null == procedure ? null == that.procedure : procedure.equals(that.procedure))
- && (null == param ? null == that.param : param.equals(that.param)));
+ && (null == param ? null == that.param : param.equals(that.param));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -67,11 +67,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof UnaryFunctionUnaryPredicate) {
- return equals((UnaryFunctionUnaryPredicate) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof UnaryFunctionUnaryPredicate && equals((UnaryFunctionUnaryPredicate) that));
}
/**
@@ -80,8 +77,7 @@
* @return boolean
*/
public boolean equals(UnaryFunctionUnaryPredicate that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -64,11 +64,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof UnaryFunctionUnaryProcedure) {
- return equals((UnaryFunctionUnaryProcedure) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof UnaryFunctionUnaryProcedure && equals((UnaryFunctionUnaryProcedure) that));
}
/**
@@ -77,8 +74,7 @@
* @return boolean
*/
public boolean equals(UnaryFunctionUnaryProcedure that) {
- return that == this
- || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+ return null != that && (null == function ? null == that.function : function.equals(that.function));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java Wed Apr 9 12:56:50 2008
@@ -65,11 +65,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof UnaryPredicateUnaryFunction) {
- return equals((UnaryPredicateUnaryFunction) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof UnaryPredicateUnaryFunction && equals((UnaryPredicateUnaryFunction) that));
}
/**
@@ -78,8 +75,7 @@
* @return boolean
*/
public boolean equals(UnaryPredicateUnaryFunction that) {
- return that == this
- || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+ return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryProcedureUnaryFunction.java Wed Apr 9 12:56:50 2008
@@ -62,11 +62,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof UnaryProcedureUnaryFunction) {
- return equals((UnaryProcedureUnaryFunction) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof UnaryProcedureUnaryFunction && equals((UnaryProcedureUnaryFunction) that));
}
/**
@@ -75,8 +72,7 @@
* @return boolean
*/
public boolean equals(UnaryProcedureUnaryFunction that) {
- return that == this
- || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+ return null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java Wed Apr 9 12:56:50 2008
@@ -119,11 +119,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Constant) {
- return equals((Constant) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Constant && equals((Constant) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java Wed Apr 9 12:56:50 2008
@@ -58,11 +58,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsInstanceOf) {
- return equals((IsInstanceOf) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsInstanceOf && equals((IsInstanceOf) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Limit.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Limit.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Limit.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Limit.java Wed Apr 9 12:56:50 2008
@@ -81,4 +81,5 @@
return "Limit<" + max + ">";
}
+ //default == equals/hashCode due to statefulness
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java Wed Apr 9 12:56:50 2008
@@ -82,4 +82,5 @@
return "Offset<" + min + ">";
}
+ //default == equals/hashCode due to statefulness
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java Wed Apr 9 12:56:50 2008
@@ -57,11 +57,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ComparatorFunction) {
- return equals((ComparatorFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ComparatorFunction && equals((ComparatorFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java Wed Apr 9 12:56:50 2008
@@ -75,11 +75,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsEquivalent) {
- return equals((IsEquivalent) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsEquivalent && equals((IsEquivalent) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java Wed Apr 9 12:56:50 2008
@@ -72,11 +72,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsGreaterThan) {
- return equals((IsGreaterThan) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsGreaterThan && equals((IsGreaterThan) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java Wed Apr 9 12:56:50 2008
@@ -72,11 +72,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsGreaterThanOrEqual) {
- return equals((IsGreaterThanOrEqual) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsGreaterThanOrEqual && equals((IsGreaterThanOrEqual) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java Wed Apr 9 12:56:50 2008
@@ -72,11 +72,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsLessThan) {
- return equals((IsLessThan) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsLessThan && equals((IsLessThan) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java Wed Apr 9 12:56:50 2008
@@ -72,11 +72,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsLessThanOrEqual) {
- return equals((IsLessThanOrEqual) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsLessThanOrEqual && equals((IsLessThanOrEqual) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java Wed Apr 9 12:56:50 2008
@@ -74,11 +74,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof IsNotEquivalent) {
- return equals((IsNotEquivalent) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof IsNotEquivalent && equals((IsNotEquivalent) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java Wed Apr 9 12:56:50 2008
@@ -88,13 +88,7 @@
return false;
}
final IsWithinRange isWithinRange = (IsWithinRange) o;
- if (!max.equals(isWithinRange.max)) {
- return false;
- }
- if (!min.equals(isWithinRange.min)) {
- return false;
- }
- return true;
+ return max.equals(isWithinRange.max) && min.equals(isWithinRange.min);
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java Wed Apr 9 12:56:50 2008
@@ -59,11 +59,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Max) {
- return equals((Max) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Max && equals((Max) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java Wed Apr 9 12:56:50 2008
@@ -59,11 +59,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Min) {
- return equals((Min) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Min && equals((Min) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java Wed Apr 9 12:56:50 2008
@@ -47,13 +47,15 @@
* {@inheritDoc}
*/
public boolean equals(Object object) {
- if (object instanceof AbstractLoopProcedure) {
- AbstractLoopProcedure that = (AbstractLoopProcedure) object;
- return (null == getCondition() ? null == that.getCondition() : getCondition().equals(that.getCondition()))
- && (null == getAction() ? null == that.getAction() : getAction().equals(that.getAction()));
- } else {
+ if (object == this) {
+ return true;
+ }
+ if (object instanceof AbstractLoopProcedure == false) {
return false;
}
+ AbstractLoopProcedure that = (AbstractLoopProcedure) object;
+ return (null == getCondition() ? null == that.getCondition() : getCondition().equals(that.getCondition()))
+ && (null == getAction() ? null == that.getAction() : getAction().equals(that.getAction()));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java Wed Apr 9 12:56:50 2008
@@ -104,11 +104,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof And) {
- return equals((And) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof And && equals((And) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java Wed Apr 9 12:56:50 2008
@@ -104,11 +104,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryAnd) {
- return equals((BinaryAnd) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BinaryAnd && equals((BinaryAnd) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java Wed Apr 9 12:56:50 2008
@@ -70,11 +70,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryCompositeBinaryFunction) {
- return equals((BinaryCompositeBinaryFunction) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof BinaryCompositeBinaryFunction && equals((BinaryCompositeBinaryFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java Wed Apr 9 12:56:50 2008
@@ -62,11 +62,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryNot) {
- return equals((BinaryNot) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BinaryNot && equals((BinaryNot) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java Wed Apr 9 12:56:50 2008
@@ -104,11 +104,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinaryOr) {
- return equals((BinaryOr) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BinaryOr && equals((BinaryOr) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java Wed Apr 9 12:56:50 2008
@@ -97,11 +97,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof BinarySequence) {
- return equals((BinarySequence) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof BinarySequence && equals((BinarySequence) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java Wed Apr 9 12:56:50 2008
@@ -109,11 +109,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof CompositeUnaryFunction) {
- return equals((CompositeUnaryFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof CompositeUnaryFunction && equals((CompositeUnaryFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -99,11 +99,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof CompositeUnaryPredicate) {
- return equals((CompositeUnaryPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof CompositeUnaryPredicate && equals((CompositeUnaryPredicate) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -105,11 +105,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof CompositeUnaryProcedure) {
- return equals((CompositeUnaryProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof CompositeUnaryProcedure && equals((CompositeUnaryProcedure) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java Wed Apr 9 12:56:50 2008
@@ -75,11 +75,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalBinaryFunction) {
- return equals((ConditionalBinaryFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalBinaryFunction && equals((ConditionalBinaryFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -74,11 +74,8 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalBinaryPredicate) {
- return equals((ConditionalBinaryPredicate) that);
- } else {
- return false;
- }
+ return that == this
+ || (that instanceof ConditionalBinaryPredicate && equals((ConditionalBinaryPredicate) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -81,11 +81,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalBinaryProcedure) {
- return equals((ConditionalBinaryProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalBinaryProcedure && equals((ConditionalBinaryProcedure) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java Wed Apr 9 12:56:50 2008
@@ -75,11 +75,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalFunction) {
- return equals((ConditionalFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalFunction && equals((ConditionalFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java Wed Apr 9 12:56:50 2008
@@ -74,11 +74,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalPredicate) {
- return equals((ConditionalPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalPredicate && equals((ConditionalPredicate) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java Wed Apr 9 12:56:50 2008
@@ -78,11 +78,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalProcedure) {
- return equals((ConditionalProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalProcedure && equals((ConditionalProcedure) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java Wed Apr 9 12:56:50 2008
@@ -75,11 +75,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalUnaryFunction) {
- return equals((ConditionalUnaryFunction) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalUnaryFunction && equals((ConditionalUnaryFunction) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java Wed Apr 9 12:56:50 2008
@@ -74,11 +74,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalUnaryPredicate) {
- return equals((ConditionalUnaryPredicate) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalUnaryPredicate && equals((ConditionalUnaryPredicate) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java Wed Apr 9 12:56:50 2008
@@ -78,11 +78,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof ConditionalUnaryProcedure) {
- return equals((ConditionalUnaryProcedure) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof ConditionalUnaryProcedure && equals((ConditionalUnaryProcedure) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java Wed Apr 9 12:56:50 2008
@@ -58,24 +58,6 @@
/**
* {@inheritDoc}
*/
- public boolean equals(Object object) {
- if (object instanceof DoWhileProcedure) {
- return super.equals(object);
- } else {
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public int hashCode() {
- return super.hashCode("DoWhileProcedure".hashCode());
- }
-
- /**
- * {@inheritDoc}
- */
public String toString() {
return "DoWhileProcedure<do(" + getAction() + ") while(" + getCondition() + ")>";
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java Wed Apr 9 12:56:50 2008
@@ -63,11 +63,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Not) {
- return equals((Not) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Not && equals((Not) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java Wed Apr 9 12:56:50 2008
@@ -102,11 +102,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Or) {
- return equals((Or) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Or && equals((Or) that));
}
/**
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java?rev=646506&r1=646505&r2=646506&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java Wed Apr 9 12:56:50 2008
@@ -99,11 +99,7 @@
* {@inheritDoc}
*/
public boolean equals(Object that) {
- if (that instanceof Sequence) {
- return equals((Sequence) that);
- } else {
- return false;
- }
+ return that == this || (that instanceof Sequence && equals((Sequence) that));
}
/**