commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1160393 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstance.java
Date Mon, 22 Aug 2011 19:39:30 GMT
Author: simonetripodi
Date: Mon Aug 22 19:39:30 2011
New Revision: 1160393

URL: http://svn.apache.org/viewvc?rev=1160393&view=rev
Log:
fixed checkstyle violations: 4 and 37 are magic numbers

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

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstance.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstance.java?rev=1160393&r1=1160392&r2=1160393&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstance.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstance.java
Mon Aug 22 19:39:30 2011
@@ -41,6 +41,14 @@ public final class IsInstance<T> impleme
      * serialVersionUID declaration.
      */
     private static final long serialVersionUID = 9104265415387129627L;
+    /**
+     * The non zero number used to shift the initial hashcode.
+     */
+    private static final int NONZERO_SHIFT_NUMBER = 4;
+    /**
+     * The non zero number used to bitwise or the hashcode.
+     */
+    private static final int NONZERO_BITWISE_NUMBER = 37;
 
     // predicate interface
     // ------------------------------------------------------------------------
@@ -63,7 +71,7 @@ public final class IsInstance<T> impleme
      * {@inheritDoc}
      */
     public int hashCode() {
-        return ("IsInstance".hashCode() << 4) | 37;
+        return ("IsInstance".hashCode() << NONZERO_SHIFT_NUMBER) | NONZERO_BITWISE_NUMBER;
     }
 
     /**



Mime
View raw message