RFR: 6450193: After the first Serialization, JTableHeader does not uninstall its UI [v3]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Fri Sep 22 07:18:12 UTC 2023
On Mon, 11 Sep 2023 19:05:25 GMT, Alexey Ivanov <aivanov at openjdk.org> 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
More information about the client-libs-dev
mailing list