commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1170782 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
Date Wed, 14 Sep 2011 19:18:32 GMT
Author: simonetripodi
Date: Wed Sep 14 19:18:31 2011
New Revision: 1170782

URL: http://svn.apache.org/viewvc?rev=1170782&view=rev
Log:
fixed checkstyle violation: '4' is a magic number.

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java

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=1170782&r1=1170781&r2=1170782&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 Sep 14 19:18:31 2011
@@ -46,6 +46,9 @@ public final class ConditionalUnaryProce
      * serialVersionUID declaration.
      */
     private static final long serialVersionUID = -895833369740247391L;
+
+    /** Base hash integer used to shift hash */
+    private static final int HASH_SHIFT = 4;
     // attributes
     // ------------------------------------------------------------------------
     private final UnaryPredicate<? super A> ifPred;
@@ -122,15 +125,15 @@ public final class ConditionalUnaryProce
     public int hashCode() {
         int hash = "ConditionalUnaryProcedure".hashCode();
         if (null != ifPred) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= ifPred.hashCode();
         }
         if (null != thenProc) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= thenProc.hashCode();
         }
         if (null != elseProc) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= elseProc.hashCode();
         }
         return hash;



Mime
View raw message