RFR: 8370013: Refactor Double.toHexString to eliminate regex and StringBuilder
Joe Darcy
darcy at openjdk.org
Mon Oct 20 15:27:03 UTC 2025
On Mon, 20 Oct 2025 04:40:45 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> The existing regression tests may be adequate for this refactoring as the high-level algorithm and special cases are similar, but I'll want to take another look before approving this PR. Thanks.
Looking over test/jdk/java/lang/ToHexString.java and the new code, I think test cases like the following should be added:
0x1.0p1, // Max trailing zeros
0x1.1p1,
0x1.01p1,
...
0x1.000000000001p1 // No trailing zeros
Specifically, numbers with all the possible numbers of trailing zeros should be explicitly tested.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27811#issuecomment-3422569440
More information about the core-libs-dev
mailing list