RFR: 8286441: Remove mode parameter from jdk.internal.perf.Perf.attach() [v2]
Ioi Lam
iklam at openjdk.java.net
Wed May 11 02:43:25 UTC 2022
On Tue, 10 May 2022 19:59:41 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> review comments
>
> src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/PerfDataBuffer.java line 60:
>
>> 58: FileChannel fc = new RandomAccessFile(f, "r").getChannel();
>> 59: ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0L, (int)fc.size());
>> 60: fc.close(); // doesn't need to remain open
>
> I think you can change this to:
>
>
> try (FileChannel fc = FileChannel.open(f.toPath())) {
> ByteBuffer bb = ...
> createPerfDataBuffer(bb, 0);
> }
Fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8622
More information about the serviceability-dev
mailing list