This is an automated email from the ASF dual-hosted git repository.
nfsantos pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 784d38ef84 OAK-12044 - Optimize PathUtils.concat for the case where
parent is the root directory. (#2669)
784d38ef84 is described below
commit 784d38ef842b16cb186f190de784c7da9842f607
Author: Nuno Santos <[email protected]>
AuthorDate: Sun Dec 21 11:42:05 2025 +0100
OAK-12044 - Optimize PathUtils.concat for the case where parent is the root
directory. (#2669)
---
.../src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java
b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java
index d74bfd41e5..656cf34be1 100644
--- a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java
+++ b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/PathUtils.java
@@ -317,8 +317,11 @@ public final class PathUtils {
} else if (isAbsolutePath(subPath)) {
throw new IllegalArgumentException("Cannot append absolute path "
+ subPath);
}
- String separator = denotesRootPath(parentPath) ? "" : "/";
- return parentPath + separator + subPath;
+ if (denotesRootPath(parentPath)) {
+ return parentPath + subPath;
+ } else {
+ return parentPath + "/" + subPath;
+ }
}
/**