RFR: 8275338: Add JFR events for notable serialization situations [v3]

Erik Gahlin egahlin at openjdk.org
Tue Dec 19 17:18:44 UTC 2023


On Tue, 19 Dec 2023 12:17:38 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> src/jdk.jfr/share/classes/jdk/jfr/events/SerializationMisdeclarationEvent.java line 48:
>> 
>>> 46: 
>>> 47:     @Label("Kind")
>>> 48:     public int kind;
>> 
>> What is the use case for error codes? Are they public or an implementation detail?
>
> The intent is that they are stable and for programmatic usage, whereas the message is more for human consumption. The codes are used in the test, for example, and are declared as public static in the event classes.
> 
> Alternatively, one could parse the message, but that's less robust in face of changes, I think.

Users (not OpenJDK developers) don't know what the error code means. I think it's better to not have them. This is how other events work. If you want to guard against changes, I would export the package to the test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17129#discussion_r1431716132


More information about the hotspot-jfr-dev mailing list