reschke commented on code in PR #411:
URL:
https://github.com/apache/jackrabbit-filevault/pull/411#discussion_r2728738666
##########
vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateImpl.java:
##########
@@ -623,6 +627,14 @@ private void addNamespacePath(Set<String> prefixes, String
path) throws Reposito
private void loadNamespaces() {
if (namespacePrefixes == null) {
+ // Check if this aggregate's namespaces are already cached
+ String[] cachedPrefixes = mgr.getCachedAggregatePrefixes(path);
+ if (cachedPrefixes != null) {
+ log.debug("Using cached namespace prefixes for '{}': {}",
path, cachedPrefixes);
Review Comment:
AFAICT, this code is never reached when running the filevault test suite.
We need a test case that actually covers this case.
##########
vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/AggregateManagerImpl.java:
##########
@@ -324,6 +345,100 @@ public String getNamespaceURI(String prefix) throws
RepositoryException {
return session.getNamespaceURI(prefix);
}
+ /**
+ * Gets a namespace URI from the cache or from the session if not cached.
+ * This method caches the prefix-to-URI mapping to avoid repeated JCR
lookups.
+ *
+ * @param prefix the namespace prefix
+ * @return the namespace URI
+ * @throws RepositoryException if an error occurs
+ */
Review Comment:
How is this better than using the JCR namespace registry? Why do we need a
cache here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]