On Tue, 5 Oct 2021 08:13:53 GMT, Andrey Turbanov <d...@openjdk.java.net> wrote:

> 8274893: Update java.desktop classes to use try-with-resources

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.

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

PR: https://git.openjdk.java.net/jdk/pull/5817

Reply via email to