Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8280550: SplittableRandom#nextDouble(double,double) can return result >= bound #7221

Closed
wants to merge 2 commits into from

Conversation

jddarcy
Copy link
Member

@jddarcy jddarcy commented Jan 26, 2022

Use floating-point library methods to nudge down the result if needed. The nextAfter(r, origin) call return the next value in the direction of origin, handling cases for negative values, etc.

Changing to call nextDown for the origin is bounded at zero is just a refactoring that is clearer to read IMO.

The regression test fails on an unpatched JDK.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8280550: SplittableRandom#nextDouble(double,double) can return result >= bound

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7221/head:pull/7221
$ git checkout pull/7221

Update a local copy of the PR:
$ git checkout pull/7221
$ git pull https://git.openjdk.java.net/jdk pull/7221/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7221

View PR using the GUI difftool:
$ git pr show -t 7221

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7221.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 26, 2022

👋 Welcome back darcy! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@jddarcy The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jan 26, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 26, 2022
@mlbridge
Copy link

mlbridge bot commented Jan 26, 2022

Webrevs

Copy link
Member

@JimLaskey JimLaskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@jddarcy This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8280550: SplittableRandom#nextDouble(double,double) can return result >= bound

Reviewed-by: jlaskey, psandoz

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 9 new commits pushed to the master branch:

  • f34f8d4: 8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection
  • a07e19d: 8278410: Improve argument processing around UseHeavyMonitors
  • ed0df2f: 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"
  • c180070: 8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492
  • a24f44d: 8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}
  • e72eefd: 8280531: Remove unused DeferredCloseInputStream
  • 2c64a7f: 8280374: G1: Remove unnecessary prev bitmap mark
  • a183bfb: 8280377: MethodHandleProxies does not correctly invoke default methods with varags
  • 2eab86b: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 26, 2022
@jddarcy
Copy link
Member Author

jddarcy commented Jan 26, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

Going to push as commit 0c42e43.
Since your change was applied there have been 14 commits pushed to the master branch:

  • a5a11f1: Merge
  • ef08e2c: 8280592: Small javadoc tweaks to foreign API
  • b8365aa: 8268978: Document the javadoc software stack
  • 4b2370e: 8279294: NonblockingQueue::try_pop may improperly indicate queue is empty
  • e1d8f55: 8280402: Add new convenience forms to HtmlTree
  • f34f8d4: 8277983: Remove unused fields from sun.net.www.protocol.jar.JarURLConnection
  • a07e19d: 8278410: Improve argument processing around UseHeavyMonitors
  • ed0df2f: 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"
  • c180070: 8280373: Update Xalan serializer / SystemIDResolver to align with JDK-8270492
  • a24f44d: 8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}
  • ... and 4 more: https://git.openjdk.java.net/jdk/compare/295c0474c43484e793b67a70af316aaae49fe361...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 26, 2022
@openjdk openjdk bot closed this Jan 26, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 26, 2022
@openjdk
Copy link

openjdk bot commented Jan 26, 2022

@jddarcy Pushed as commit 0c42e43.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants