Author: simonetripodi
Date: Wed Sep  7 20:29:02 2011
New Revision: 1166388

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

Modified: 
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java?rev=1166388&r1=1166387&r2=1166388&view=diff
==============================================================================
--- 
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
 (original)
+++ 
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
 Wed Sep  7 20:29:02 2011
@@ -45,6 +45,9 @@ public final class ConditionalPredicate 
      * serialVersionUID declaration.
      */
     private static final long serialVersionUID = 7333505000745854098L;
+
+    /** Base hash integer used to shift hash */
+    private static final int HASH_SHIFT = 4;
     // attributes
     // ------------------------------------------------------------------------
     private final Predicate ifPred;
@@ -102,15 +105,15 @@ public final class ConditionalPredicate 
     public int hashCode() {
         int hash = "ConditionalPredicate".hashCode();
         if (null != ifPred) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= ifPred.hashCode();
         }
         if (null != thenPred) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= thenPred.hashCode();
         }
         if (null != elsePred) {
-            hash <<= 4;
+            hash <<= HASH_SHIFT;
             hash ^= elsePred.hashCode();
         }
         return hash;


Reply via email to