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


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/impl/GlobalNameMapper.java:
##########
@@ -143,17 +146,23 @@ public String getExpandedJcrName(@NotNull String oakName) 
{
         int colon = oakName.indexOf(':');
         if (colon > 0) {
             String oakPrefix = oakName.substring(0, colon);
-            // local mapping must take precedence...
-            uri = getSessionLocalMappings().get(oakPrefix);
+            uri = getNamespacesProperty(oakPrefix);
+            // global mapping must take precedence...
             if (uri == null) {
-                // ...over global mappings
-                uri = getNamespacesProperty(oakPrefix);
+                // ...over local mappings
+                uri = getSessionLocalMappings().get(oakPrefix);
             }
             if (uri == null) {
                 throw new IllegalStateException(
                         "No namespace mapping found for " + oakName);
             }
             localName = oakName.substring(colon + 1);
+            // check namespace name for validity in Oak
+            if (!isValidNamespaceName(uri)) {
+                throw new IllegalStateException(
+                    new NamespaceException("Cannot determine expanded name for 
'" + oakName +

Review Comment:
   Well, it is possible. That's bad, but changing that could be a breaking 
change. Note that this case already is error-logged.



-- 
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]

Reply via email to