Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7924

ValidationModelRetriever does not correctly evaluate "applicable path"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Validation Core 1.0.4
    • Validation Core 1.0.6
    • Validation
    • None

    Description

      Currently in https://github.com/apache/sling-org-apache-sling-validation-core/blob/4d56bb636a3b68cd1bed5d6b03f194a41e0aef75/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java#L114 there is a PatriciaTrie from Apache Commons Collections being used to figure out the validation model bound to a specific resource with the most specific applicable path which still matches.

      This does not work as the method PatriciaTrie.subMap returns all keys which are less than the given path according to lexicographical ordering.

      That means, in case the trie would contain entries for "/", and "/a/b", a lookup for "/a/c" would return "/a/b" although the latter does not start with the former.

      Attachments

        Activity

          People

            kwin Konrad Windszus
            kwin Konrad Windszus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: