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

Jukka Zitting commented on OAK-708:
-----------------------------------

Looks good to me. Some potential improvements:

* The child node count could be memorized when first accessed to avoid having 
to recalculate over and over again.
* Note that the {{AbstractChildNode.getChildNodeCount()}} method already does 
more or less the same thing you're doing, so a simpler alternative might be:

{code}
if (rs.includes(ReadStatus.DENY_CHILDREN)) {
    childNodeCount = 0;
} else {
    childNodeCount = super.getChildNodeCount();
}
{code}

... or, since the {{getChildNodeEntries()}} method already optimizes for the 
{{DENY_CHILDREN}} case, you could simply memorize the return value of 
{{super.getChildNodeCount()}}.
                
> SecureNodeState#getChildNodeCount and #getPropertyCount: don't respect read 
> permissions
> ---------------------------------------------------------------------------------------
>
>                 Key: OAK-708
>                 URL: https://issues.apache.org/jira/browse/OAK-708
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>          Components: core, jcr
>            Reporter: angela
>         Attachments: OAK-708-patch.txt
>
>


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

Reply via email to