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

hashCode of RestrictionImpl doesn't include value

    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

        1. OAK-5784.patch
          37 kB
          Angela Schreiber
        2. ace_creation_noRestrictionFix_withSave.txt
          166 kB
          Angela Schreiber
        3. ace_creation_restrictionHashFix_withSave.txt
          172 kB
          Angela Schreiber

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: