You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2012/07/31 15:29:34 UTC

[jira] [Created] (OAK-214) PropertyImpl#getParent violates JCR API

angela created OAK-214:
--------------------------

             Summary: PropertyImpl#getParent violates JCR API
                 Key: OAK-214
                 URL: https://issues.apache.org/jira/browse/OAK-214
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: jcr
            Reporter: angela


Item#getParent mandates that an AccessDeniedException is thrown if the
parent of an item is not accessible.

however, the implementation in this case throws an InvalidItemStateException("Property is stale") and PropertyDelegate#getParent marks the return value as @Nonnull.

most probably that needs some additional fixed down the line and isn't as
trivial to fix as oak-213

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-214) PropertyImpl#getParent violates JCR API

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425782#comment-13425782 ] 

angela commented on OAK-214:
----------------------------

some other areas in propertydelegate that are odd or broken due to the assumption that
parent==null indicates a stale property:


1. toString() will result in NPE:

    @Override
    public String toString() {
        // don't disturb the state: avoid calling resolve()
        return "PropertyDelegate[/" + parent.getPath() + '/' + propertyState.getName() + ']';
    }

2. getStatus() relies on property status obtained from the parent tree being null
   as a measure to determine if the property is stale while at the same time 
   isStale() checks the parent for being null. to me that looks really
   troublesome to me having 2 different ways of identifying a stale property.
   apart from the mere fact that the parent might simply not be accessible without
   necessarily having a stale property.

    @Override
    public boolean isStale() {
        resolve();
        return parent == null;
    }

    @Override
    public Status getStatus() throws InvalidItemStateException {
        Status propertyStatus = getParentTree().getPropertyStatus(getName());
        if (propertyStatus == null) {
            throw new InvalidItemStateException("Property is stale");
        }

        return propertyStatus;
    }
                
> PropertyImpl#getParent violates JCR API
> ---------------------------------------
>
>                 Key: OAK-214
>                 URL: https://issues.apache.org/jira/browse/OAK-214
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: angela
>
> Item#getParent mandates that an AccessDeniedException is thrown if the
> parent of an item is not accessible.
> however, the implementation in this case throws an InvalidItemStateException("Property is stale") and PropertyDelegate#getParent marks the return value as @Nonnull.
> most probably that needs some additional fixed down the line and isn't as
> trivial to fix as oak-213

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-214) PropertyImpl#getParent violates JCR API

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425762#comment-13425762 ] 

angela commented on OAK-214:
----------------------------

the fundamental problem here probably is the fact that 'parent == null' is used to mark
the property being stale. that's sort of problematic IMO... and is probably related
to OAK-212.
                
> PropertyImpl#getParent violates JCR API
> ---------------------------------------
>
>                 Key: OAK-214
>                 URL: https://issues.apache.org/jira/browse/OAK-214
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: angela
>
> Item#getParent mandates that an AccessDeniedException is thrown if the
> parent of an item is not accessible.
> however, the implementation in this case throws an InvalidItemStateException("Property is stale") and PropertyDelegate#getParent marks the return value as @Nonnull.
> most probably that needs some additional fixed down the line and isn't as
> trivial to fix as oak-213

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-214) PropertyImpl#getParent violates JCR API

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425786#comment-13425786 ] 

angela commented on OAK-214:
----------------------------

initial fix for PropertyImpl#getParent in revision: 1367559.
leaving issue open as the additional work is required on PropertyDelegate in order
to prevent InvalidItemStateException if the parent is not accessible.

                
> PropertyImpl#getParent violates JCR API
> ---------------------------------------
>
>                 Key: OAK-214
>                 URL: https://issues.apache.org/jira/browse/OAK-214
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: angela
>
> Item#getParent mandates that an AccessDeniedException is thrown if the
> parent of an item is not accessible.
> however, the implementation in this case throws an InvalidItemStateException("Property is stale") and PropertyDelegate#getParent marks the return value as @Nonnull.
> most probably that needs some additional fixed down the line and isn't as
> trivial to fix as oak-213

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira