Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-27

hashCode implementation of Field is not correct

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0.0 Final
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Two objects can be equal but have different hashcodes - this means they cannot be used as a key in a hashmap!

      public boolean equals(Object object)

      { if (super.equals(object) == true) return true; if (!(object instanceof Field)) return false; return tag == ((Field) object).getField() && getObject().equals(((Field) object).getObject()); }

      public int hashCode()

      { return object.hashCode(); }

        Attachments

          Activity

            People

            • Assignee:
              admin Steve Bate
              Reporter:
              tim.wright@aspectcapital.com Tim Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: