commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r922715 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java
Date Sun, 14 Mar 2010 01:38:14 GMT
Author: sebb
Date: Sun Mar 14 01:38:14 2010
New Revision: 922715

URL: http://svn.apache.org/viewvc?rev=922715&view=rev
Log:
MATH-335 Fraction.hashCode() inconsistent with Fraction.equals()
Change hashCode() to use fields directly

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java?rev=922715&r1=922714&r2=922715&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java
Sun Mar 14 01:38:14 2010
@@ -383,7 +383,7 @@ public class Fraction
      */
     @Override
     public int hashCode() {
-        return 37 * (37 * 17 + getNumerator()) + getDenominator();
+        return 37 * (37 * 17 + numerator) + denominator;
     }
 
     /**



Mime
View raw message