You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/09/07 22:00:47 UTC
svn commit: r1166359 -
/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
Author: simonetripodi
Date: Wed Sep 7 20:00:46 2011
New Revision: 1166359
URL: http://svn.apache.org/viewvc?rev=1166359&view=rev
Log:
fixed checkstyle violations: '4' is a magic number.
Modified:
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
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=1166359&r1=1166358&r2=1166359&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 Sep 7 20:00:46 2011
@@ -34,6 +34,10 @@ public abstract class AbstractLoopProced
* serialVersionUID declaration.
*/
private static final long serialVersionUID = -5903381842630236070L;
+
+ /** Base hash integer used to shift hash */
+ private static final int HASH_SHIFT = 4;
+
private final Predicate condition;
private final Procedure action;
@@ -82,11 +86,11 @@ public abstract class AbstractLoopProced
* @return int
*/
protected int hashCode(int hash) {
- hash <<= 4;
+ hash <<= HASH_SHIFT;
if (null != getAction()) {
hash ^= getAction().hashCode();
}
- hash <<= 4;
+ hash <<= HASH_SHIFT;
if (null != getCondition()) {
hash ^= getCondition().hashCode();
}