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-1880) Same name sibling: Jackrabbit behaves differently when calling Node.getPath()
Date Wed, 26 Nov 2008 10:36:46 GMT

    [ https://issues.apache.org/jira/browse/JCR-1880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650935#action_12650935
] 

Stefan Guggisberg commented on JCR-1880:
----------------------------------------

> Is it valid to use a NodeImpl object after a workspace-level method such as session.move()
was used that involved the given node? 

the lifespan of javax.jcr.Item instances is not clearly specified by JSR 170. 
Item instances in jackrabbit are valid as long as they're being referenced.

JSR 283 will contain specific statements wrt the lifespan of javax.jcr.Item instances.   

> Same name sibling: Jackrabbit behaves differently when calling Node.getPath()
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1880
>                 URL: https://issues.apache.org/jira/browse/JCR-1880
>             Project: Jackrabbit
>          Issue Type: Bug
>            Reporter: Thomas Mueller
>            Priority: Minor
>
> The following test case behaves differently when calling Node.getPath() versus not calling
it:
> void test(boolean index) throws Exception {
> 	FileUtils.deleteDirectory(new File("repository"));
> 	Repository rep = new TransientRepository();
> 	Session session = rep.login(new SimpleCredentials("", new char[0]));
> 	Node test = session.getRootNode().addNode("test");
> 	Node a = test.addNode("a");
> 	Node b = a.addNode("b");
> 	session.save();
> 	session.move("/test/a/b", "/test/a");
> 	if (index) {
> 		b.getPath();
> 	}
> 	session.move("/test/a", "/test/a");
> 	System.out.println("a: " + a.getPath());
> 	System.out.println("b: " + b.getPath());
> 	session.logout();
> }	
> test(true) prints:
> a: /test/a[2]
> b: /test/a
> test(false) prints:
> a: /test/a
> b: /test/a

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