Re: Incorrect note in Javadoc for a few RandomGenerator methods

2024-06-21 Thread Stig Rohde Døssing
Thanks, filed 9077206.

Den fre. 21. jun. 2024 kl. 21.06 skrev Raffaello Giulietti <
raffaello.giulie...@oracle.com>:

> Hi,
>
> your observation seems correct.
>
> In order to file a properly tracked bug report, please proceed according
> to this guide:
>
>
> https://docs.oracle.com/en/java/javase/22/troubleshoot/submit-bug-report.html
>
> Thanks
>
>
>
> On 2024-06-21 19:12, Stig Rohde Døssing wrote:
> > Hi,
> >
> > The Javadoc for RandomGenerator.nextLong(long origin, long bound) has
> > this to say:
> >
> > Implementation Requirements:
> > The default implementation checks that |origin| and |bound| are positive
> > |longs|
> >
> > |This doesn't seem to be true. The default implementation checks that
> > origin and bound are a valid range (that bound >= origin). The
> > implementation doesn't reject negative inputs.|
> > |
> > |
> > |The same note appears in the two-arg version of nextInt.|
> > |
> > |
> > |The note for e.g. nextDouble is correct and says "|The default
> > implementation verifies that the |origin| and |bound| are valid"
> >
> > I'm wondering if the notes for nextLong and nextInt should be updated to
> > match?
>


Incorrect note in Javadoc for a few RandomGenerator methods

2024-06-21 Thread Stig Rohde Døssing
Hi,

The Javadoc for RandomGenerator.nextLong(long origin, long bound) has this
to say:

Implementation Requirements:The default implementation checks that origin
and bound are positive longs

This doesn't seem to be true. The default implementation checks that origin
and bound are a valid range (that bound >= origin). The implementation
doesn't reject negative inputs.

The same note appears in the two-arg version of nextInt.

The note for e.g. nextDouble is correct and says "The default
implementation verifies that the origin and bound are valid"

I'm wondering if the notes for nextLong and nextInt should be updated to
match?