[OpenJDK 2D-Dev] Review Request for JDK-7059970 : Test case: javax/imageio/plugins/png/ITXtTest.java is not closing a file

Brian Burkhalter brian.burkhalter at oracle.com
Fri Jul 8 18:05:05 UTC 2016

Hi Jay,

Sorry to be picky here but in doTest() could you not instead have

        try {
            writeTo(file, src);
            ITXtTest dst = readFrom(file);
            if (dst == null || !dst.equals(src)) {
                throw new RuntimeException("Test failed.");
        } catch (RuntimeException re) {
            throw re;
        } finally {
        System.out.println("Test passed.");

and therefore remove f.delete() from writeTo() and  readFrom()?



On Jul 8, 2016, at 12:04 AM, Jayathirth D V <jayathirth.d.v at oracle.com> wrote:

> 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160708/b733cb5c/attachment.html>

More information about the 2d-dev mailing list