[
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