harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5979) [classlib][luni] - File.deleteOnExit has different behaviours with RI
Date Wed, 17 Sep 2008 05:49:44 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Regis Xu updated HARMONY-5979:
------------------------------

    Attachment: HARMONY-5979.diff

It's hard to write a unit test, so I wrote a test must be run and checked manually

File f1 = new File("d1");
f1.mkdirs();
File f2 = new File("d1/d2");
f2.mkdirs();
File f3 = new File("d1/d2/f1");
f3.createNewFile();

f3.deleteOnExit();
f2.deleteOnExit();
f1.deleteOnExit();
both d1 and d1/d2 should be left

File f1 = new File("d1");
f1.mkdirs();
File f2 = new File("d1/d2");
f2.mkdirs();
File f3 = new File("d1/d2/f1");
f3.createNewFile();

f2.deleteOnExit();
f3.deleteOnExit();
f1.deleteOnExit();
only d1 should be left

File f1 = new File("d1");
f1.mkdirs();
File f2 = new File("d1/d2");
f2.mkdirs();
File f3 = new File("d1/d2/f1");
f3.createNewFile();

f1.deleteOnExit();
f2.deleteOnExit();
f3.deleteOnExit();
nothing left

> [classlib][luni] - File.deleteOnExit has different behaviours with RI
> ---------------------------------------------------------------------
>
>                 Key: HARMONY-5979
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5979
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M7
>            Reporter: Regis Xu
>             Fix For: 5.0M8
>
>         Attachments: HARMONY-5979.diff
>
>
> consider the following test:
>         File f1 = new File("d1");
>         f1.mkdirs();
>         File f2 = new File("d1/d2");
>         f2.mkdirs();
>         File f3 = new File("d1/d2/f1");
>         f3.createNewFile();
>         
>         f3.deleteOnExit();
>         f2.deleteOnExit();
>         f1.deleteOnExit();
> RI leaves d1 and d2, while Harmony deletes all of the three files. If we change the order
of invoke deleteOnExit to
>         f2.deleteOnExit();
>         f3.deleteOnExit();
>         f1.deleteOnExit();
> RI leaves d1, Harmony also detete all the three files. It seems RI delete files in the
reverse order of invoking deleteOnExit.
> And spec doesn't mention which order should be used, is it a non-bug difference, or we
should fix it to be compatible with RI?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message