RFR: 8275338: Add JFR events for notable serialization situations [v12]
Daniel Fuchs
dfuchs at openjdk.org
Tue Jan 9 18:35:26 UTC 2024
On Tue, 9 Jan 2024 10:42:58 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
>> src/java.base/share/classes/java/io/SerializationMisdeclarationChecker.java line 87:
>>
>>> 85: }
>>> 86: if (cl.isEnum()) {
>>> 87: commitEvent(cl, SUID_NAME + " in an enum class is not effective");
>>
>> Is there a best practice that can be included in the message? "SUID should not be declared"?
>
> Yes, that's perhaps clearer, will do.
Typically in other places in the JDK we use `priviledgedXxx` for naming methods that are simple wrappers that call `xxx` from within a `doPrivileged`. The method is called privileged because it doesn't require the caller to use `doPrivileged`.
That is something like:
String privilegedGetProperty(String property) {
return AccessController.doPrivileged((...) () -> System.getProperty(property));
}
See for instance: https://github.com/openjdk/jdk/blob/ee98d262181f5822609674c71c85ad4576ac1632/src/java.base/share/classes/sun/security/action/GetPropertyAction.java#L107
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17129#discussion_r1446460008
More information about the core-libs-dev
mailing list