commons-commits mailing list archives

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

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

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=1166381&r1=1166380&r2=1166381&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 Sep  7 20:19:48 2011
@@ -46,6 +46,9 @@ public final class ConditionalBinaryFunc
      * serialVersionUID declaration.
      */
     private static final long serialVersionUID = -994698971284481482L;
+
+    /** Base hash integer used to shift hash */
+    private static final int HASH_SHIFT = 4;
     // attributes
     // ------------------------------------------------------------------------
     private final BinaryPredicate<? super L, ? super R> ifPred;
@@ -113,15 +116,15 @@ public final class ConditionalBinaryFunc
     public int hashCode() {
         int hash = "ConditionalBinaryFunction".hashCode();
         if (null != ifPred) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= ifPred.hashCode();
         }
         if (null != thenFunc) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= thenFunc.hashCode();
         }
         if (null != elseFunc) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= elseFunc.hashCode();
         }
         return hash;



Mime
View raw message