RFR: JDK-8313251: Add NativeLibraryLoad event [v2]
Erik Gahlin
egahlin at openjdk.org
Wed Aug 2 12:31:52 UTC 2023
On Wed, 2 Aug 2023 11:28:45 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> test/jdk/jdk/jfr/event/runtime/TestNativeLibraryLoadEvent.java line 51:
>>
>>> 49:
>>> 50: public static void main(String[] args) throws Throwable {
>>> 51: Recording recording = new Recording();
>>
>> Use try-with-resources.
>
> Hi Erik, this was taken from test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java , I do not see in main there a try with resources. What do you want to put in the try block exactly ? The new Recording() ?
Yes.
try (Recording r = new Recording()) {
...
}
It's not used everywhere, but it seems proper to release chunk resources when the test is finished.
(I should probably go over all tests and change to avoid the pattern being copied.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15065#discussion_r1281834616
More information about the hotspot-jfr-dev
mailing list