On Mon, 30 Mar 2026 12:16:48 GMT, Alan Bateman <[email protected]> wrote:
>> The JSON format thread dump generated by HotSpotDiagnosticMXBean.dumpThreads
>> and jcmd Thread.dump_to_file currently converts Java longs to json strings.
>> This is changed to write longs as numbers when in the "safe range" that can
>> be parsed by JS and other system. The changes means that thread
>> identifiers, the process ID, and thread counts, are now generated as
>> numbers. threadDump.schema.json is used to document the format and is
>> updated to reflect the change. A new "formatVersion" property is added to
>> make it easier to track changes to the format going forward.
>>
>> The changes include a test-only update to JSONValue to add support for
>> numbers.. While there, it is also updated to bring it closer to current
>> proposal/JSON for convenience methods. This will make it easier to replace
>> this test library class once a standard API is further along. A number of
>> security tests and one JFR test are updated, all trivial changes.
>>
>> Testing: Tier 1-5.
>
> Alan Bateman has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Fix indent
test/lib/jdk/test/lib/json/JSONValue.java line 669:
> 667:
> 668: default double asDouble() {
> 669: throw new UnsupportedOperationException("Unsupported conversion
> to number");
Nit: Messages at lines 661, 665 and 669 could be more specific, e.g. saying:
"Unsupported conversion to double".
But maybe current messages are intentional?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30467#discussion_r3012112254