You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2010/10/12 15:20:35 UTC

[jira] Created: (JCR-2779) A jcr:uuid property added manually isn't attached to the parent node

A jcr:uuid property added manually isn't attached to the parent node
--------------------------------------------------------------------

                 Key: JCR-2779
                 URL: https://issues.apache.org/jira/browse/JCR-2779
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
            Reporter: angela
             Fix For: 2.2.0


- take a nt:unstructured node without any mixins.
- set a property with name jcr:uuid
- the parent obtained from that property is the same as the test node (expected)
- the declaring node type of that property is nt:unstructured as expected

but:
- the property isn't new (instead it is modified) 
- there is no property-name entry for it in the parent node.

if it was illegal to add a jcr:uuid property that is not defined by mix:referenceable i would expect
that the setProperty-call fails.

the following test illustrates the behaviour:

public void testAddJcrUUIDProperty() throws RepositoryException {
        Node testNode = testRootNode.addNode(nodeName2, "nt:unstructured");
        superuser.save();

        assertFalse(testNode.hasProperty("jcr:mixinTypes"));
        assertFalse(testNode.isNodeType(mixReferenceable));

        Property p = testNode.setProperty("jcr:uuid", superuser.getValueFactory().createValue(false));
        assertTrue(testNode.isSame(p.getParent()));
        assertEquals("nt:unstructured", p.getDefinition().getDeclaringNodeType().getName());

        assertTrue(p.isNew());
        assertTrue(testNode.hasProperty("jcr:uuid"));
    }

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


[jira] Commented: (JCR-2779) A jcr:uuid property added manually isn't attached to the parent node

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920624#action_12920624 ] 

Stefan Guggisberg commented on JCR-2779:
----------------------------------------

this issue is caused by the implementation of
AbstractBundlePersistanceManager.load(PropertyId id);

this method always returns 'jcr:uuid' PropertyState instances, whether
such a property is declared on the node or not.

this may lead to inconsistent NodeState/PropertyState 
instances, as demonstrated by this issue. 

before r1001707 (JCR-2699) the problem was not apparent since
the existence was checked in SharedItemStateManager.getItemState()
by calling hasNonVirtualItemState().

> A jcr:uuid property added manually isn't attached to the parent node
> --------------------------------------------------------------------
>
>                 Key: JCR-2779
>                 URL: https://issues.apache.org/jira/browse/JCR-2779
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: angela
>             Fix For: 2.2.0
>
>
> - take a nt:unstructured node without any mixins.
> - set a property with name jcr:uuid
> - the parent obtained from that property is the same as the test node (expected)
> - the declaring node type of that property is nt:unstructured as expected
> but:
> - the property isn't new (instead it is modified) 
> - there is no property-name entry for it in the parent node.
> if it was illegal to add a jcr:uuid property that is not defined by mix:referenceable i would expect
> that the setProperty-call fails.
> the following test illustrates the behaviour:
> public void testAddJcrUUIDProperty() throws RepositoryException {
>         Node testNode = testRootNode.addNode(nodeName2, "nt:unstructured");
>         superuser.save();
>         assertFalse(testNode.hasProperty("jcr:mixinTypes"));
>         assertFalse(testNode.isNodeType(mixReferenceable));
>         Property p = testNode.setProperty("jcr:uuid", superuser.getValueFactory().createValue(false));
>         assertTrue(testNode.isSame(p.getParent()));
>         assertEquals("nt:unstructured", p.getDefinition().getDeclaringNodeType().getName());
>         assertTrue(p.isNew());
>         assertTrue(testNode.hasProperty("jcr:uuid"));
>     }

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