Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-5784

hashCode of RestrictionImpl doesn't include value

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0, 1.6.1, 1.8.0
    • core

    Description

      The hashCode generation of RestrictionImpl currently looks as follows:

          public int hashCode() {
              return Objects.hashCode(definition, property);
          }
      

      However, the hashCode of our PropertyState implementation doesn't include the value. See AbstractPropertyState:

      public static int hashCode(PropertyState property) {
              return property.getName().hashCode();
          }
      

      Consequently the hashCode of the AccessControlEntry implementation, the validation of ACEs in AccessControlValidator and the AcEntry created in the PermissionHook generates the same hashCode for entries that only differ by the value of a restriction.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            angela Angela Schreiber
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment