Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAK-10623: oak-core: log a warning when it needs to remap/add a namespace #1282

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading