commons-commits mailing list archives

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

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

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java?rev=1166386&r1=1166385&r2=1166386&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
Wed Sep  7 20:28:01 2011
@@ -46,6 +46,9 @@ public final class ConditionalFunction<T
      * serialVersionUID declaration.
      */
     private static final long serialVersionUID = 4214871352184887792L;
+
+    /** Base hash integer used to shift hash */
+    private static final int HASH_SHIFT = 4;
     // attributes
     // ------------------------------------------------------------------------
     private final Predicate ifPred;
@@ -110,15 +113,15 @@ public final class ConditionalFunction<T
     public int hashCode() {
         int hash = "ConditionalFunction".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