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 Alex Parvulescu <al...@gmail.com> on 2013/02/19 10:14:50 UTC

How should the current Tree and NodeState apis behave in the case of a null child name?

hi,

apologies if this has been discussed already and I missed it.

I ran into this via some tets in the AccessControlManagerImplTest that
trigger a NPE in the Segment MK impl [0].

I'm looking at the Tree and the NodeState interfaces, I see a lot of api
docs about the returned value but no constraints about the input child name.
Is null considered a valid input?

Either way I think we should build in proper null checks for all existing
implementations.

thoughts?

thanks,
alex


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

Re: How should the current Tree and NodeState apis behave in the case of a null child name?

Posted by Alex Parvulescu <al...@gmail.com>.
> Null doesn't make any sense there, so I'd consider it invalid

Perfect, see attached patch on OAK-635. I used a combo of @Nonnull and
checkNotNull
to enforce this constraint.

alex

On Tue, Feb 19, 2013 at 10:22 AM, Michael Dürig <mi...@gmail.com> wrote:

> +1
> Michael
> On Feb 19, 2013 9:20 AM, "Jukka Zitting" <ju...@gmail.com> wrote:
>
> > Hi,
> >
> > On Tue, Feb 19, 2013 at 11:14 AM, Alex Parvulescu
> > <al...@gmail.com> wrote:
> > > I'm looking at the Tree and the NodeState interfaces, I see a lot of
> api
> > > docs about the returned value but no constraints about the input child
> > name.
> > > Is null considered a valid input?
> >
> > Null doesn't make any sense there, so I'd consider it invalid. Empty
> > strings should probably be treated equally.
> >
> > BR,
> >
> > Jukka Zitting
> >
>

Re: How should the current Tree and NodeState apis behave in the case of a null child name?

Posted by Michael Dürig <mi...@gmail.com>.
+1
Michael
On Feb 19, 2013 9:20 AM, "Jukka Zitting" <ju...@gmail.com> wrote:

> Hi,
>
> On Tue, Feb 19, 2013 at 11:14 AM, Alex Parvulescu
> <al...@gmail.com> wrote:
> > I'm looking at the Tree and the NodeState interfaces, I see a lot of api
> > docs about the returned value but no constraints about the input child
> name.
> > Is null considered a valid input?
>
> Null doesn't make any sense there, so I'd consider it invalid. Empty
> strings should probably be treated equally.
>
> BR,
>
> Jukka Zitting
>

Re: How should the current Tree and NodeState apis behave in the case of a null child name?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Feb 19, 2013 at 11:14 AM, Alex Parvulescu
<al...@gmail.com> wrote:
> I'm looking at the Tree and the NodeState interfaces, I see a lot of api
> docs about the returned value but no constraints about the input child name.
> Is null considered a valid input?

Null doesn't make any sense there, so I'd consider it invalid. Empty
strings should probably be treated equally.

BR,

Jukka Zitting