What is meant by "document context" in JEP 198?

Alan Bateman Alan.Bateman at oracle.com
Fri Nov 25 07:52:02 UTC 2022


On 25/11/2022 02:04, Ethan McCue wrote:
> I suppose while I'm asking questions - what exactly are the parts of 
> the JDK making use of ad-hoc json? Maybe we could ship *something* as 
> a jdk.internal module for those use cases?
>
JEP 198 pre-dates records, sealed classes, pattern matching, ... and I 
will assume will re-drafted or replaced when the time comes.

Right now, I don't think there are too many places in the JDK that 
interact with JSON.  The `jfr` tool can print the records from a JFR 
recording as a JSON document. The HotSpotDiagnosMXBean API and `jcmd` 
tool can generate a thread dump as a JSON document. I think the only 
parsing at this time is the HotSpot compiler control (JEP 165) where 
directives file is a subset of JSON but that is implemented in C++ in 
libjvm and probably not what you are looking for.

There are number of places in the JDK that read configuration and it 
might be that some of these could consume configuration in JSON in the 
future.

-Alan


More information about the core-libs-dev mailing list