[ 
https://issues.apache.org/jira/browse/SLING-3481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13949616#comment-13949616
 ] 

Tobias Bocanegra commented on SLING-3481:
-----------------------------------------

Well, the problem is not only in the proxy but with all classes that decorate a 
JCR interface.
I don't know what the best pattern is - should they always returns decorators 
so that the symmetry is preserved? 

the JCR javadoc is a big vague here, if the "same == identical" object should 
be returned in the reverse methods, eg:

http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Item.html#getSession():
{quote}
Returns the Session through which this Item was acquired.
{quote}

and: 
http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getRepository()
{quote}
Returns the Repository object through which this session was acquired.
{quote}

If you take the javadoc literally, I think the contract indeed is, that the 
identical object needs to be returned. So a compliant implementation should 
ensure that all returned objects are properly decorated, so that they can 
return the original session and/or repository.





> AbstractSlingRepository2.login().getRepository() not symmetric
> --------------------------------------------------------------
>
>                 Key: SLING-3481
>                 URL: https://issues.apache.org/jira/browse/SLING-3481
>             Project: Sling
>          Issue Type: Bug
>          Components: General
>    Affects Versions: JCR Base 2.2.2
>            Reporter: Tobias Bocanegra
>            Priority: Minor
>             Fix For: JCR Base 2.2.4
>
>         Attachments: SLING-3481.r1582018..patch
>
>
> the AbstractSlingRepository2.login() returns a session, which does not return 
> the same repository object in 'getRepository()'.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to