nfsantos commented on code in PR #1596:
URL: https://github.com/apache/jackrabbit-oak/pull/1596#discussion_r1687600834


##########
oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java:
##########
@@ -367,11 +367,13 @@ public static boolean isAncestor(String ancestor, String 
path) {
         if (denotesRoot(ancestor)) {
             if (denotesRoot(path)) {
                 return false;
+            } else {
+                return path.startsWith(ancestor);

Review Comment:
   I agree that the use of assert in this class is confusing, probably a 
misguided attempt at reducing runtime overhead. Maybe it made sense 10 years 
ago, but now I don't think it is justifiable. It should probably be replaced 
with standard error checking using Preconditions or something similar.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to