<i18n dev> RFR: 8274893: Update java.desktop classes to use try-with-resources [v2]
Andrey Turbanov
duke at openjdk.java.net
Wed Oct 13 07:40:51 UTC 2021
On Tue, 12 Oct 2021 06:16:00 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Andrey Turbanov has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - 8274893: Update java.desktop classes to use try-with-resources
>> close nested resources too
>> - [PATCH] Use try-with-resources to close resources in java.desktop
>
> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java line 587:
>
>> 585: // Pending: verify character encoding spec for gconf
>> 586: StringBuilder sb = new StringBuilder();
>> 587: try (Reader reader = new InputStreamReader(url.openStream(), ISO_8859_1)) {
>
> I did not check all code but look like in some places the close method was missed when a few streams were wrapped.
> Looks like in this place, the "url.openStream()" may be leaked if the constructor of InputStreamReader will throw an exception. Please check other places for similar issues.
updated
-------------
PR: https://git.openjdk.java.net/jdk/pull/5817
More information about the i18n-dev
mailing list