Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-335

Fraction.hashCode() inconsistent with Fraction.equals()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      Fraction.hashCode() is inconsistent with Fraction.equals().

      hashCode() uses getNumerator() (which is not final) rather than directly accessing the field.

      Seems to me that hashCode() has no reason to use the getters - or if it does, then equals should do so too.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: