Uploaded image for project: 'Crowd'
  1. Crowd
  2. CWD-4335

ImmutableGroup breaks contract between equals and hashCode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.3
    • Component/s: Embedded
    • Labels:
      None

      Description

      Class com.atlassian.crowd.embedded.impl.ImmutableGroup has broken contract between hashCode and equals method - hashCode is derived from a group name however equals compares case insensitive group name. So hashcode for "Group1" and "group1" would be different, however they would be equal. It is problematic especially when groups are put into HashSets or are used as keys in HashMaps. Also com.atlassian.crowd.embedded.api.Group interface specifies that hashCode needs to be case insensitive.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tsroka Tomek
              Reporter:
              tsroka Tomek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: