Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Validation Core 1.0.4
-
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.