Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-5851

Prism hashCode is not consistent with equals

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0.1, 4.1
    • Prism
    • None
    • Internal

    Description

      There are situations where object1.equals(object2) but object1.hashCode() != object2.hashCode(). This is a kind of bug that waits for its time to bite us deeply.

      The raw values are the cause. (Not known if there are other cases.)

      shadow: (87d72df2-5aae-4df3-9aeb-a82692c0466d, v0, ShadowType)
          intent: default
          kind: ACCOUNT
          objectClass: {...resource/instance-3}inetOrgPerson
          resourceRef: oid=0a37121f-d515-4a23-9b6d-554c5ef61272(ResourceType)[default]
          attributes: 
              entryUUID: 3a6d24fa-7a39-49e6-b0da-9bdf801800f4
              dn: uid=banderson,ou=people,dc=example,dc=com
          iteration: 0
          iterationToken: 
          lifecycleState: proposed
          metadata: 
              requestTimestamp: 2019-10-15T16:59:17.993+02:00
              createChannel: http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user
              createTimestamp: 2019-10-15T16:59:19.678+02:00
          primaryIdentifierValue: 3a6d24fa-7a39-49e6-b0da-9bdf801800f4
          name: uid=banderson,ou=people,dc=example,dc=com 

      equals

      shadow: (87d72df2-5aae-4df3-9aeb-a82692c0466d, v0, ShadowType)
          name: uid=banderson,ou=people,dc=example,dc=com
          metadata: 
              requestTimestamp: 2019-10-15T16:59:17.993+02:00
              createTimestamp: 2019-10-15T16:59:19.678+02:00
              createChannel: http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user
          lifecycleState: proposed
          resourceRef: oid=0a37121f-d515-4a23-9b6d-554c5ef61272(ResourceType)[default]
          objectClass: {...resource/instance-3}inetOrgPerson
          primaryIdentifierValue: 3a6d24fa-7a39-49e6-b0da-9bdf801800f4
          kind: ACCOUNT
          intent: default
          iteration: 0
          iterationToken: 
          attributes: 
              dn: [ uid=banderson,ou=people,dc=example,dc=com (raw) ]
              entryUUID: [ 3a6d24fa-7a39-49e6-b0da-9bdf801800f4 (raw) ] 

      but hash codes are different.

      Attachments

        Issue Links

          Activity

            People

              mederly Pavol Mederly
              mederly Pavol Mederly
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: