commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1166361 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
Date Wed, 07 Sep 2011 20:04:21 GMT
Author: simonetripodi
Date: Wed Sep  7 20:04:20 2011
New Revision: 1166361

URL: http://svn.apache.org/viewvc?rev=1166361&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/BinaryCompositeBinaryFunction.java

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=1166361&r1=1166360&r2=1166361&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 Sep  7 20:04:20 2011
@@ -43,6 +43,9 @@ public class BinaryCompositeBinaryFuncti
      */
     private static final long serialVersionUID = 2570517284319064043L;
 
+    /** Base hash integer used to shift hash */
+    private static final int HASH_SHIFT = 4;
+
     /**
      * Type-remembering Helper
      *
@@ -132,11 +135,11 @@ public class BinaryCompositeBinaryFuncti
      */
     public int hashCode() {
         int hash = "BinaryCompositeBinaryFunction".hashCode();
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= helper.f.hashCode();
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= helper.g.hashCode();
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= helper.h.hashCode();
         return hash;
     }



Mime
View raw message