-
Sub-task
-
Resolution: Delivered
-
P4
-
23
-
In Review
A new `jdk.SerializationMisdeclaration` JFR event type is added to the platform. Such an event is triggered at runtime when some aspect of serialization related fields and methods are improperly declared. By enabling `jdk.SerializationMisdeclaration`, JFR will trigger an event for each incorrectly declared aspect of a serializable class when it is loaded in the JVM.
For example, if the `writeObject()` method on a `Serializable` class has the correct signature but is unintentionally declared `public`, it is not selected by the serialization machinery. This might come as a surprise to the developer of the class. To help diagnose such problems, `jdk.SerializationMisdeclaration` events should be enabled.
The standard `default.jfc` profile does _not_ enable these events, while the standard `profile.jfc` profile does.
For example, if the `writeObject()` method on a `Serializable` class has the correct signature but is unintentionally declared `public`, it is not selected by the serialization machinery. This might come as a surprise to the developer of the class. To help diagnose such problems, `jdk.SerializationMisdeclaration` events should be enabled.
The standard `default.jfc` profile does _not_ enable these events, while the standard `profile.jfc` profile does.