jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-580) Add Root#getRootTree (or getTreeRoot)
Date Thu, 24 Jan 2013 09:43:12 GMT

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

Michael Dürig commented on OAK-580:
-----------------------------------

So the additional method won't save us from the {{null}} check. IMO {{getRootTree()}} instead
of {{getTree("/")}} alone isn't a big win such that it'd warrant a new method in the API.
Won't' fix!?

[~mreutegg]: The Javadoc is somewhat miss leading and could be improved. {{Root}} was never
intended to be a (ISA) {{Tree}} but rather a handle for getting a {{Tree}} and/or the root
of a {{Tree}}. In the tree/root analogy it is more like the ground on which the tree grows.
Them name clash between {{Root}} and the root of a {{Tree}} is a bit unfortunate but we weren't
able to come up with a better name back then. 
                
> Add Root#getRootTree (or getTreeRoot)
> -------------------------------------
>
>                 Key: OAK-580
>                 URL: https://issues.apache.org/jira/browse/OAK-580
>             Project: Jackrabbit Oak
>          Issue Type: Wish
>            Reporter: angela
>            Assignee: Michael Dürig
>
> in the current source we are having more than 150 usages of {code}Root.getTree("/"){code}.
most of those calls are used to retrieve
> other items or are passed to method calls that don't expect a null value.
> since from my understanding the root-tree will never be null this basically
> correct. nevertheless my IDE complains as the getTree method is annotated
> with @CheckForNull.
> wouldn't it be desirable to add a convenience method to the Root interface that allows
to access the root-tree? for example
> {code}
> /**
>  * Returns the root tree.
>  */
> @Nonnull
> Tree getRootTree();
> {code}

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

Mime
View raw message