commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marcospera...@apache.org
Subject svn commit: r1360574 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: VertexPair.java elo/DefaultKFactorBuilder.java model/InMemoryPath.java
Date Thu, 12 Jul 2012 08:19:40 GMT
Author: marcosperanza
Date: Thu Jul 12 08:19:40 2012
New Revision: 1360574

URL: http://svn.apache.org/viewvc?rev=1360574&view=rev
Log:
Fixed 'MagicNumber' checkstyle error

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/VertexPair.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/elo/DefaultKFactorBuilder.java
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/VertexPair.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/VertexPair.java?rev=1360574&r1=1360573&r2=1360574&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/VertexPair.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/VertexPair.java Thu
Jul 12 08:19:40 2012
@@ -75,8 +75,9 @@ public final class VertexPair<V>
      */
     @Override
     public int hashCode()
-    {
-        return hash( 1, 31, head, tail );
+    {        
+        final int prime = 31;
+        return hash( 1, prime, head, tail );
     }
 
     /**

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/elo/DefaultKFactorBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/elo/DefaultKFactorBuilder.java?rev=1360574&r1=1360573&r2=1360574&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/elo/DefaultKFactorBuilder.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/elo/DefaultKFactorBuilder.java
Thu Jul 12 08:19:40 2012
@@ -80,8 +80,9 @@ final class DefaultKFactorBuilder<P>
                 break;
 
             case DRAW:
-                sA = 0.5;
-                sB = 0.5;
+                final double number = 0.5;
+                sA = number;
+                sB = number;
                 break;
 
             default: // should not happen

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java?rev=1360574&r1=1360573&r2=1360574&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/model/InMemoryPath.java
Thu Jul 12 08:19:40 2012
@@ -226,7 +226,8 @@ public class InMemoryPath<V, E>
     @Override
     public int hashCode()
     {
-        return hash( 1, 31, edges, source, target, vertices );
+        final int prime = 31;
+        return hash( 1, prime, edges, source, target, vertices );
     }
 
     /**



Mime
View raw message