Skip to content

Commit

Permalink
OAK-10623: oak-core: log a warning when it needs to remap/add a names…
Browse files Browse the repository at this point in the history
…pace (apache#1282)
  • Loading branch information
reschke authored Jan 23, 2024
1 parent 8703590 commit fe83565
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,6 +34,8 @@ public class LocalNameMapper extends GlobalNameMapper {

protected final Map<String, String> local;

private static final Logger log = LoggerFactory.getLogger(LocalNameMapper.class);

public LocalNameMapper(Root root, Map<String, String> local) {
super(root);
this.local = local;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit fe83565

Please sign in to comment.