[ 
https://issues.apache.org/jira/browse/SLING-3213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Klco updated SLING-3213:
----------------------------

    Attachment: has-children.diff

Carsten,

Thanks for the feedback, I have made the changes you suggested.  Right now, I 
have the resource resolver just calling listChildren(resource).hasNext().  It 
seems to me like the negligible performance gain from doing the check in the 
method would be outweighed by the cost of maintaining duplicate code.

I did also leave the implementation of the method in the JcrPropertyResource 
since there should not be child resources of a property and listJcrChildren 
there already returns null.

Please let me know what you think of the latest patch.

Regards,
Dan

> Resource hasChildren Convenience Method
> ---------------------------------------
>
>                 Key: SLING-3213
>                 URL: https://issues.apache.org/jira/browse/SLING-3213
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: API 2.4.2
>            Reporter: Dan Klco
>            Assignee: Dan Klco
>            Priority: Minor
>              Labels: features, patch
>         Attachments: has-children.diff
>
>
> Add a method to the Resource interface for checking if a resource has child 
> resources.  This could either invoke an underlying implementation's 
> equivalent method or simply invoke listResources().hasNext() if the 
> underlying implementation does not have an appropriate method.
> I also added an EL function since the function naming isn't JavaBean 
> compliant.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to