[
https://issues.apache.org/jira/browse/OAK-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13529108#comment-13529108
]
Michael Dürig commented on OAK-343:
-----------------------------------
Thanks for the patch. A few comments
* Please use Guava instead of commons collections. See Oak-200.
* Don't use start imports, import each class/member explicitly.
* I'd rename {{InternalIndexProvider}} to {{UUIDIndexProvider}} and move the
implementation to the end of the file.
* {{UUIDQueryIndex.query()}} relies on the side effects of a prior call to
{{UUIDQueryIndex.getCost()}}. Can we really rely of {{getCost()}} having been
called at the point when {{query()}} is called? If so {{QueryIndexProvider}}
should clearly state this in its contract. Otherwise it might be better to use
a memoisation pattern for {{UUIDQueryIndex.path}} and explicitly calculate it
if it wasn't calculated before.
> Session.getNodeByUUID requires save call
> ----------------------------------------
>
> Key: OAK-343
> URL: https://issues.apache.org/jira/browse/OAK-343
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, jcr
> Reporter: angela
> Attachments: oak-343.patch
>
>
> while adding mix:referenceable to a new node immediately assigns a
> uuid and makes the node referenceable, session.getNodeByUUID only works
> after saving the changes.
> the following test illustrates this behavior:
> @Test
> public void getNodeByUUID() throws RepositoryException {
> Node node = getNode("/foo").addNode("boo");
> node.addMixin(JcrConstants.MIX_REFERENCEABLE);
> assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
> String uuid = node.getUUID();
> assertNotNull(uuid);
> assertEquals(uuid, node.getIdentifier());
> Node nAgain = node.getSession().getNodeByUUID(uuid);
> assertTrue(nAgain.isSame(node));
> assertTrue(nAgain.isSame(node.getSession().getNodeByIdentifier(uuid)));
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira