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 Marcel Reutegger <mr...@adobe.com> on 2012/09/06 14:29:04 UTC

Root.getTree(String)

hi,

the method Root.getTree(String) does not specify any restrictions for
the passed path string (relative, absolute?). RootImpl then forwards
the call to its rootTree which asserts that the path is absolute. I'd be
good to state this in JavaDoc. on the other hand it seems like the
implementation would also work OK with a relative path or even
an empty path as implemented in PathUtils.isValid(String).

opinions?

regards
 marcel

Re: Root.getTree(String)

Posted by Michael Dürig <md...@apache.org>.

On 6.9.12 14:12, Marcel Reutegger wrote:
> OK, see OAK-291.
>
> what about Tree?
>
> e.g. I'm a bit confused by the following method:
>
>      /**
>       * @return  path of this {@code Tree} instance relative to its {@link Root}.
>       */
>      @Nonnull
>      String getPath();

Right, that's confusing. Its a leftover from an earlier version where 
the path was indeed relative to the workspace (which lived inside the 
Root).

>
> this sounds like the returned path is relative. how about:
>
>      /**
>       * @return the absolute path of this {@code Tree} instance from its {@link Root}.
>       */
>      @Nonnull
>      String getPath();

Much better! +1.

Michael

>
> regards
>   marcel
>
>> -----Original Message-----
>> From: Michael Dürig [mailto:mduerig@apache.org]
>> Sent: Donnerstag, 6. September 2012 14:53
>> To: oak-dev@jackrabbit.apache.org
>> Subject: Re: Root.getTree(String)
>>
>>
>>
>> On 6.9.12 13:50, Michael Dürig wrote:
>>>
>>> Hi,¨
>>>
>>> On 6.9.12 13:29, Marcel Reutegger wrote:
>>>> the method Root.getTree(String) does not specify any restrictions for
>>>> the passed path string (relative, absolute?).
>>>
>>> This has come up before. See
>>> https://issues.apache.org/jira/browse/OAK-221. The Oak core API is only
>>> concerned with absolute paths. Maybe we should make this more explicit
>>> in the Javadoc.
>>
>> Ermm, that was the case before TreeLocation was introduced. The latter
>> actually can handle relative paths. So I think its best to document all
>> paths used in Root as absolute.
>>
>> Michael
>>
>>>
>>> Michael

RE: Root.getTree(String)

Posted by Marcel Reutegger <mr...@adobe.com>.
OK, see OAK-291.

what about Tree?

e.g. I'm a bit confused by the following method:

    /**
     * @return  path of this {@code Tree} instance relative to its {@link Root}.
     */
    @Nonnull
    String getPath();

this sounds like the returned path is relative. how about:

    /**
     * @return the absolute path of this {@code Tree} instance from its {@link Root}.
     */
    @Nonnull
    String getPath();

regards
 marcel

> -----Original Message-----
> From: Michael Dürig [mailto:mduerig@apache.org]
> Sent: Donnerstag, 6. September 2012 14:53
> To: oak-dev@jackrabbit.apache.org
> Subject: Re: Root.getTree(String)
> 
> 
> 
> On 6.9.12 13:50, Michael Dürig wrote:
> >
> > Hi,¨
> >
> > On 6.9.12 13:29, Marcel Reutegger wrote:
> >> the method Root.getTree(String) does not specify any restrictions for
> >> the passed path string (relative, absolute?).
> >
> > This has come up before. See
> > https://issues.apache.org/jira/browse/OAK-221. The Oak core API is only
> > concerned with absolute paths. Maybe we should make this more explicit
> > in the Javadoc.
> 
> Ermm, that was the case before TreeLocation was introduced. The latter
> actually can handle relative paths. So I think its best to document all
> paths used in Root as absolute.
> 
> Michael
> 
> >
> > Michael

Re: Root.getTree(String)

Posted by Michael Dürig <md...@apache.org>.

On 6.9.12 13:50, Michael Dürig wrote:
>
> Hi,¨
>
> On 6.9.12 13:29, Marcel Reutegger wrote:
>> the method Root.getTree(String) does not specify any restrictions for
>> the passed path string (relative, absolute?).
>
> This has come up before. See
> https://issues.apache.org/jira/browse/OAK-221. The Oak core API is only
> concerned with absolute paths. Maybe we should make this more explicit
> in the Javadoc.

Ermm, that was the case before TreeLocation was introduced. The latter 
actually can handle relative paths. So I think its best to document all 
paths used in Root as absolute.

Michael

>
> Michael

Re: Root.getTree(String)

Posted by Michael Dürig <md...@apache.org>.
Hi,¨

On 6.9.12 13:29, Marcel Reutegger wrote:
> the method Root.getTree(String) does not specify any restrictions for
> the passed path string (relative, absolute?).

This has come up before. See 
https://issues.apache.org/jira/browse/OAK-221. The Oak core API is only 
concerned with absolute paths. Maybe we should make this more explicit 
in the Javadoc.

Michael