reschke commented on code in PR #1447:
URL: https://github.com/apache/jackrabbit-oak/pull/1447#discussion_r1598158217


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadOnlyNamespaceRegistry.java:
##########
@@ -112,4 +120,53 @@ public String getPrefix(String uri) throws 
NamespaceException {
                 "No namespace prefix registered for URI " + uri);
     }
 
+    protected void checkConsistency() {
+        final String jcrPrimaryType = "jcr:primaryType";
+        List<String> prefixes = Arrays.asList(getPrefixes());
+        List<String> uris = Arrays.asList(getURIs());
+        if (prefixes.size() != uris.size()) {
+            LOG.error("The namespace registry is inconsistent: found {} 
registered prefixes and {} registered URIs. The numbers have to be equal.", 
prefixes.size(), uris.size());

Review Comment:
   In the log messages, I'd replace "URI" by either "namespace name" or 
"namespace URI", and "prefix" to "namespace prefix".



##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadOnlyNamespaceRegistry.java:
##########
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.name;
 
-import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;
 import static java.util.Collections.emptyList;
+import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;

Review Comment:
   Can we remove the Guava-ism whilere we are at it?



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to