[OpenJDK 2D-Dev] Review Request for JDK-7059970 : Test case: javax/imageio/plugins/png/ITXtTest.java is not closing a file
Jayathirth D V
jayathirth.d.v at oracle.com
Fri Jul 8 07:04:24 UTC 2016
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.race at oracle.com"philip.race at 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160708/ebe6f1a6/attachment.html>
More information about the 2d-dev
mailing list