Hi Phil and Brian,
Thanks for your inputs. I have made following updates: 1) Added new bug-id in the test case. 2) Using try-with-resources for closing streams. I can't perform f.delete() in finally block of writeTo() and readFrom() because "test.png" is shared resource between the methods. So I am deleting "test.png" at places where we are throwing RumtimeException. Please find updated webrev for review: http://cr.openjdk.java.net/~jdv/7059970/webrev.01/ Thanks, Jay From: Brian Burkhalter Sent: Friday, July 08, 2016 2:17 AM To: Phil Race Cc: Jayathirth D V; 2d-dev Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-7059970 : Test case: javax/imageio/plugins/png/ITXtTest.java is not closing a file Good point - probably better to make it explicit then. The try-with-resources should still be cleaner for closing the streams however. Brian On Jul 7, 2016, at 1:26 PM, Phil Race <HYPERLINK "mailto:philip.r...@oracle.com"philip.r...@oracle.com> wrote: I suppose deleteOnExit might be OK but jtreg re-uses the VM so it will not get deleted until much later - after all N thousand tests have been run .. assuming no other test crashes the VM before then. -phil. On 07/07/2016 10:41 AM, Brian Burkhalter wrote: Why not simply invoke deleteOnExit() on the file instance immediately after it is created and use try-with-resources blocks for the Image{Input,Output}Stream instances?