[ 
https://issues.apache.org/jira/browse/JCR-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Guggisberg updated JCR-2599:
-----------------------------------

    Resolution: Invalid
        Status: Resolved  (was: Patch Available)

not a bug since the described behavior is according to the spec.

see 
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Node.html#addMixin(java.lang.String)

<quote>
[...] Semantically, the mixin node type assignment may take effect immediately 
and at the very least, it must take effect on save.[...]
</quote>

> Adding mix:shareable mixin is not effective until save()
> --------------------------------------------------------
>
>                 Key: JCR-2599
>                 URL: https://issues.apache.org/jira/browse/JCR-2599
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.0.0
>            Reporter: Thomas Draier
>         Attachments: JCR-2599.patch
>
>
> Hi,
> After adding the mix:shareable mixin to a node - the node is not directly 
> usable for a clone. The NodeImpl.isShareable() method still returns false. 
> Trying to clone it before doing a save lead to the following exception :
> javax.jcr.RepositoryException: node /test is not shareable.
>       at 
> org.apache.jackrabbit.core.NodeImpl.addShareParent(NodeImpl.java:3039)
>       at org.apache.jackrabbit.core.NodeImpl.clone(NodeImpl.java:1907)
> After saving the node, it's possible to clone without error.
> This can be fixed by adding the following code at the end of 
> NodeImpl.addMixin : 
>             if (mixin.isDerivedFrom(NameConstants.MIX_SHAREABLE)) {
>                 thisState.addShare(getParentId());
>             }   
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to