RFR: 8307298: JFR: Ensure jdk.jfr.internal.TypeLibrary is initialized only once [v2]
Severin Gehwolf
sgehwolf at openjdk.org
Wed May 10 18:46:20 UTC 2023
On Wed, 10 May 2023 17:00:21 GMT, Robert Toyonaga <duke at openjdk.org> wrote:
>> src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java line 103:
>>
>>> 101: if (initialized) {
>>> 102: return;
>>> 103: }
>>
>> Perhaps it would make sense to add a comment as to why that check needs to be there? Something like this perhaps?
>>
>>
>> // TypeLibrary is initialized once by MetadataRepository (which is a singleton). So shouldn't happen practice.
>> // However, some tools (GraalVM native image) may call the initialization routine twice.
>
> Good idea. I've added a comment with an explanation.
Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13760#discussion_r1190264189
More information about the hotspot-jfr-dev
mailing list