You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2023/02/15 15:35:00 UTC

[jira] [Updated] (OAK-5229) Using Node.setPrimaryType() should fail if non-matching childnodes

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

Julian Reschke updated OAK-5229:
--------------------------------
    Description: 
1. Assume the following:
{noformat}
/testNode [nt:unstructured]
  /unstructured_child [nt:unstructured]
{noformat}

2. setting "/testNode".setPrimaryType("nt:folder")
3. save the session.

Altering the primary type works, thus leaving the repository in an inconsistent state.

Interestingly, subsequent calls to "/testNode/unstructured_child".setProperty() will fail:

{noformat}
javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: /test_node[[nt:folder]]: No matching definition found for child node unstructured_child with effective type [nt:unstructured]
{noformat}



  was:
1. Assume the following:
{noformat}
/testNode [nt:unstructured]
  /unstructured_child [nt:unstructured]
{noformat}

2. setting "/testNode".setPrimaryType("nt:folder")
3. save the session.

Altering the primary type works, thus leaving the repository in an inconsistent state.

Interestingly, subsequent calls to "/testNiode/unstructured_child".setProperty() will fail:

{noformat}
javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: /test_node[[nt:folder]]: No matching definition found for child node unstructured_child with effective type [nt:unstructured]
{noformat}




> Using Node.setPrimaryType() should fail if non-matching childnodes
> ------------------------------------------------------------------
>
>                 Key: OAK-5229
>                 URL: https://issues.apache.org/jira/browse/OAK-5229
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.14
>            Reporter: Tobias Bocanegra
>            Priority: Critical
>         Attachments: OAK-5229-tests.patch, OAK-5229-v2.patch, OAK-5229-v3.patch, OAK-5229-v4.patch, OAK-5229-v5.patch, OAK-5229-v6.patch, OAK-5229.patch
>
>
> 1. Assume the following:
> {noformat}
> /testNode [nt:unstructured]
>   /unstructured_child [nt:unstructured]
> {noformat}
> 2. setting "/testNode".setPrimaryType("nt:folder")
> 3. save the session.
> Altering the primary type works, thus leaving the repository in an inconsistent state.
> Interestingly, subsequent calls to "/testNode/unstructured_child".setProperty() will fail:
> {noformat}
> javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: /test_node[[nt:folder]]: No matching definition found for child node unstructured_child with effective type [nt:unstructured]
> {noformat}



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