jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-2779) A jcr:uuid property added manually isn't attached to the parent node
Date Wed, 13 Oct 2010 16:00:38 GMT

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


Mime
View raw message