RFR: 8269909: getStack method in hprof.parser.Reader should use try-with-resource [v3]
Lin Zang
lzang at openjdk.java.net
Wed Jul 14 04:48:46 UTC 2021
On Wed, 14 Jul 2021 04:19:56 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Lin Zang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> revise code to handle the closing of embeded streams
>
> test/lib/jdk/test/lib/hprof/parser/Reader.java line 100:
>
>> 98: in.close();
>> 99: try (BufferedInputStream bis2 = new BufferedInputStream(access.asStream(0));
>> 100: PositionDataInputStream in2 = new PositionDataInputStream(bis2)) {
>
> Please fix indentation so that the type names align.
>
> Also minor nit: the '2' suffix is not needed for any of the variables now as they are scoped to the try-block.
Hi David,
Removing the `2` suffix here makes build error, as they are conflict with the outer try() at line 88. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4717
More information about the hotspot-runtime-dev
mailing list