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

Stefan Guggisberg resolved JCR-2479.
------------------------------------

    Resolution: Invalid

the said behaviour is as expected and not a bug.

> Node node = session.getRootNode().addNode("test");

test is an instance of nt:unstructured

> node.setProperty("bar", "test");

'bar" is a legal non-mandatory property declared by 
the residual property definition of nt:unstructured

> node.addMixin("nt:foo");

a property definition is added by the mixin nt:foo which declares 
a mandatory string property "bar".

note that this does not affect the existing "bar" property 
declared by nt:unstructured. 

> node.getSession().save();

=> an exception is thrown since the mandatory constrained 
declared in nt:foo is not satisfied. 

> Adding a Mixin-type with mandatory properties after setting these properties 
> throws exception
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-2479
>                 URL: https://issues.apache.org/jira/browse/JCR-2479
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 2.0-beta6
>            Reporter: Martin Buergi
>            Priority: Critical
>
> Testcase:
> nodetype definition with mandatory property:
> [nt:foo]
>  mixin
> - bar(string) mandatory
> this throws the exception "mandatory property {}bar does not exist":
> Node node = session.getRootNode().addNode("test");
> node.setProperty("bar", "test");
> node.addMixin("nt:foo");
> node.getSession().save();
> and this works at least with alpha 4 and before:
> Node node = session.getRootNode().addNode("test");
> node.addMixin("nt:foo");
> node.setProperty("bar", "test");
> node.getSession().save();

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