[ 
https://issues.apache.org/jira/browse/OAK-11486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17928092#comment-17928092
 ] 

Konrad Windszus commented on OAK-11486:
---------------------------------------

bq. So this applies to multiple methods, because I think we are not doing this 
anywhere. Separate issue?

I think this fixes this issue (among other) in the most straightforward way, 
therefore I would not track this separately.

bq. But I guess we can't fix it anyway without a high risk of breaking API 
consumers.

I lack to see how, exceptions right now are dispatched latest at save(). We 
don't stop supporting anything that has been supported before but just 
streamline the exception handling (and throw a bit earlier).

> Session-local namespace mappings for unregistered namespace URIs lead to 
> unexpected ISE for Node.getName() or Node.getPath()
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-11486
>                 URL: https://issues.apache.org/jira/browse/OAK-11486
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>    Affects Versions: 1.76.0
>            Reporter: Konrad Windszus
>            Assignee: Manfred Baedke
>            Priority: Major
>              Labels: namespace
>
> When creating a node with an unknown prefix and afterwards mapping that 
> prefix to an unregistered URI with {{Session.setNamespacePrefix(...)}} 
> ([https://developer.adobe.com/experience-manager/reference-materials/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#setNamespacePrefix(java.lang.String,%20java.lang.String])
>  calling its {{Node.getName()}} or {{Node.getPath()}} methods leads to an 
> unexpected ISE.
> According to 
> [https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.5.2%20Session-Local%20Mappings]
> bq. If a JCR method is passed a name or path containing a prefix which does 
> not exist in the local mapping an exception is thrown.
> Therefore I would expect that adding a node with an unknown prefix leads to 
> an exception immediately (without waiting for save()) while adding a node 
> with a only local mapping should not throw an exception at all.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to