Approval Request to update TreeSet#add method documentation

Martin Buchholz martinrb at google.com
Mon Oct 22 00:37:33 UTC 2018


Hi Kishor,

I think your attachment was stripped out - standard policy for this mailing
list, I think.
For a small patch like this, you should just include the patch inline in
text form.


On Thu, Oct 18, 2018 at 2:21 AM, Kishor Gollapalliwar <
kishor.gollapalliwar at gmail.com> wrote:

> Hi Team,
>
> Please provide your approval to update TreeSet#add method as it's
> documentation and behavior are not consistent.
>
> For more information, please refer my mail below and attachment.
>
> Thanks & Regards,
> *Kishor Golapelliwar,*
> The ability to convert ideas to things is the secret to outward success.
>
> ---------- Forwarded message ---------
> From: Kishor Gollapalliwar <kishor.gollapalliwar at gmail.com>
> Date: Mon, Oct 15, 2018 at 11:40 AM
> Subject: Re: Inconsistencies in TreeSet Interface
> To: <martinrb at google.com>
> Cc: <core-libs-dev at openjdk.java.net>
>
>
> Hello Everyone,
>
> This is the first time I am writing mail to this group, hence please ignore
> my nuisance and guide me towards right direction.
>
> As suggested by Martin, I believe documentation need to be updated.
> I would happy to update the documentation, please provide your inputs.
> I have attache the .java file for more details.
>
> @Martin : I really appreciate your advice and help, thank you.
>
> Thank you,
> Kishor Gollapalliwar
>
> On Sat, Oct 13, 2018 at 11:40 PM Martin Buchholz <martinrb at google.com>
> wrote:
>
> > core-libs-dev is the right mailing list.
> >
> > The documentation could be improved, but it's nuanced - consider using a
> > TreeSet with a Comparator that accepts null.
> >
> > On Sat, Oct 13, 2018 at 7:26 AM, Kishor Gollapalliwar <
> > kishor.gollapalliwar at gmail.com> wrote:
> >
> >> Hello Everyone,
> >>
> >> Introduction : I’m an enthusiast java developer. I’m a newbie in this
> >> group, hence please ignore my nuisance and guide me towards right
> >> direction.
> >>
> >> ## Problems Statement
> >>
> >> Treeset#add method documentations : “adds the specified element e to
> this
> >> set if the set contains no element e2 such that (e==null ? e2==null :
> >> e.equals(e2))”
> >>
> >> Inconsistencies:
> >>
> >> > If we try to add “null” value, it will throws NullPointerException,
> >> hence
> >> > e and e2 can not be null.
> >>
> >>
> >>
> >> > And e.compareTo(e2) ==0 || compare(e, e2)==0, it will not add to
> >> > collection.
> >>
> >>
> >> Request you to help me understand if behavior of Treeset#add method is
> as
> >> expected, and differ with set interface documentation. We may have to
> >> consider to update method documentations, if behavior is expected.
> >>
> >> For more details I have attached the sample java application.
> >>
> >> I’ve tested the behavior on Orack JDK 8u181 (64 bit) and Open JDK 8u181.
> >>
> >> Thanks & Regards,
> >> *Kishor Golapelliwar,*
> >> The ability to convert ideas to things is the secret to outward success.
> >>
> >
> >
>


More information about the core-libs-dev mailing list