commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1166359 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
Date Wed, 07 Sep 2011 20:00:47 GMT
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();
         }



Mime
View raw message