From 1848e4123981c9490ca0703bac87108aa91ed6cb Mon Sep 17 00:00:00 2001 From: Julian Reschke Date: Tue, 23 Jan 2024 14:23:18 +0100 Subject: [PATCH] OAK-10623: oak-core: log a warning when it needs to remap/add a namespace --- .../jackrabbit/oak/namepath/impl/LocalNameMapper.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/LocalNameMapper.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/LocalNameMapper.java index d64f78f1a89..6eb8d697f47 100644 --- a/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/LocalNameMapper.java +++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/LocalNameMapper.java @@ -24,6 +24,8 @@ import org.apache.jackrabbit.oak.api.Root; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Name mapper with local namespace mappings. @@ -32,6 +34,8 @@ public class LocalNameMapper extends GlobalNameMapper { protected final Map local; + private static final Logger log = LoggerFactory.getLogger(LocalNameMapper.class); + public LocalNameMapper(Root root, Map local) { super(root); this.local = local; @@ -81,6 +85,8 @@ public synchronized String getJcrName(@NotNull String oakName) { for (int i = 2; true; i++) { String jcrPrefix = oakPrefix + i; if (!local.containsKey(jcrPrefix)) { + log.warn("no prefix found for namespace name '" + uri + "', using unmapped temporary prefix '" + + jcrPrefix + "' for now (see OAK-10544)"); return jcrPrefix + oakName.substring(colon); } }