On Fri, 27 Mar 2026 09:07:37 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.

This pull request has now been integrated.

Changeset: 4a335f87
Author:    Alan Bateman <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/4a335f878c87b75a111252fafa80dbb96c52259a
Stats:     408 lines in 10 files changed: 232 ins; 42 del; 134 mod

8381002: Thread dump should convert longs to json numbers if possible

Reviewed-by: kevinw, amenkov, sspitsyn, lmesnik

-------------

PR: https://git.openjdk.org/jdk/pull/30467

Reply via email to