[ https://issues.apache.org/jira/browse/OAK-10304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732927#comment-17732927 ]
Angela Schreiber commented on OAK-10304: ---------------------------------------- [~reschke], i agree that fixing without backwards-compatibility option will likely cause issues. so, think we have a couple of options: - document this as a known limitation/bug and resolve this ticket as won't fix, but log a message when an invalid namespace is registered - fix the problem with an option to disable it for backwards compatibility, in which case i would also log a message (see before) about the log level: i would log it as a warning. apart from that i don't have a strong preference for either variant but i guess the first one is easier, no? > Oak allows registration of invalid namespace names > -------------------------------------------------- > > Key: OAK-10304 > URL: https://issues.apache.org/jira/browse/OAK-10304 > Project: Jackrabbit Oak > Issue Type: Bug > Components: core, jcr > Reporter: Julian Reschke > Assignee: Julian Reschke > Priority: Major > > Example: > {noformat} > diff --git > a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java > b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java > index f113e4e0d2..7178a36f7f 100644 > --- a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java > +++ b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java > @@ -1996,6 +1996,24 @@ public class RepositoryTest extends > AbstractRepositoryTest { > assertFalse(asList(nsReg.getURIs()).contains("file:///foo")); > } > + @Test > + public void testNamespaceNames() throws RepositoryException { > + NamespaceRegistry nsReg = > + getAdminSession().getWorkspace().getNamespaceRegistry(); > + > + // valid > + nsReg.registerNamespace("foo", "https://example.com"); > + nsReg.unregisterNamespace("foo"); > + > + // invalid > + try { > + nsReg.registerNamespace("foo", "example.com"); > + fail("should not register invalid namespace name"); > + } finally { > + nsReg.unregisterNamespace("foo"); > + } > + } > {noformat} > Note that name of nodes using invalid namespaces do have a valid "expanded > form" variant > (https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.2.5.1%20Expanded%20Form). > -- This message was sent by Atlassian Jira (v8.20.10#820010)