You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by jo...@apache.org on 2025/07/25 07:49:30 UTC
(jackrabbit-oak) branch OAK-11784-2 created (now 3eec39f80b)
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a change to branch OAK-11784-2
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at 3eec39f80b OAK-11784 instantiate the NamespaceHelper once
This branch includes the following new commits:
new 3eec39f80b OAK-11784 instantiate the NamespaceHelper once
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(jackrabbit-oak) 01/01: OAK-11784 instantiate the NamespaceHelper once
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a commit to branch OAK-11784-2
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 3eec39f80b017f970ee629dacc497af4c1f20689
Author: Joerg Hoh <jh...@adobe.com>
AuthorDate: Fri Jul 25 09:46:30 2025 +0200
OAK-11784 instantiate the NamespaceHelper once
with JCR-5161 in place the NamespaceRegistry is retrieved once during the lifetime of the
NamespaceHelper object.
---
.../main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java
index 37a154aee5..2262814b11 100644
--- a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java
+++ b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java
@@ -65,6 +65,7 @@ public class ImportHandler extends DefaultHandler {
protected Locator locator;
private TargetImportHandler targetHandler;
private final Map<String, String> tempPrefixMap = new HashMap<String, String>();
+ private final NamespaceHelper namespaceHelper;
public ImportHandler(String absPath, SessionContext sessionContext,
int uuidBehavior, boolean isWorkspaceImport) throws RepositoryException {
@@ -74,6 +75,7 @@ public class ImportHandler extends DefaultHandler {
SessionDelegate sd = sessionContext.getSessionDelegate();
root = (isWorkspaceImport) ? sd.getContentSession().getLatestRoot() : sd.getRoot();
importer = new ImporterImpl(absPath, sessionContext, root, uuidBehavior, isWorkspaceImport);
+ namespaceHelper = new NamespaceHelper(sessionContext.getSession());
}
//---------------------------------------------------------< ErrorHandler >
@@ -136,7 +138,7 @@ public class ImportHandler extends DefaultHandler {
public void startPrefixMapping(String prefix, String uri)
throws SAXException {
try {
- new NamespaceHelper(sessionContext.getSession()).registerNamespace(
+ namespaceHelper.registerNamespace(
prefix, uri);
if (targetHandler != null) {
targetHandler.startPrefixMapping(prefix, uri);