On Mon, 11 Sep 2023 19:05:25 GMT, Alexey Ivanov <[email protected]> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   try-with-resource use
>
> test/jdk/javax/swing/JTableHeader/SerializeJTableHeader.java line 46:
> 
>> 44:             for(int i = 0; i < 10; i ++){
>> 45:                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
>> 46:                 ObjectOutputStream oos = new ObjectOutputStream(baos);
> 
> You should use try with resources to close the streams as a good pattern, 
> even though closing byte-array does nothing, nor does it leak any resources.

I guess in test, resource leak probably wouldn't matter so much but anyways I 
have used try-with-resource.
Please have a look

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15507#discussion_r1333971798

Reply via email to