RFR: 8022213 Intermittent test failures in java/net/URLClassLoader (Add jdk/testlibrary/FileUtils.java)

Chris Hegarty chris.hegarty at oracle.com
Thu Nov 7 14:59:07 UTC 2013


Given both Michael and Alan's comments. I've update the webrev:
   http://cr.openjdk.java.net/~chegar/fileUtils.01/webrev/

1) more descriptive method names
2) deleteXXX methods return if interrupted, leaving the
    interrupt status set
3) Use Files.copy with REPLACE_EXISTING
4) Use SimpleFileVisitor, rather than FileVisitor

Thanks,
-Chris.

On 11/07/2013 01:24 PM, Alan Bateman wrote:
> On 07/11/2013 11:34, Chris Hegarty wrote:
>> :
>>
>> I've also received another comment offline about the method names.
>> They should be more descriptive, and highlight the difference between
>> these methods and regular delete. So maybe move to public
>> deleteWithRetry?
> That might be a bit better as otherwise it's not obvious how it differs
> from Files.delete. Also to keep the names consistent then
> deleteTreeWithRetry should probably be deleteFileTreeWithRetry.
>
> On interrupting the sleep then it looks like the methods aren't
> consistent, one will throw InterruptedException, the other will complete
> early without an exception and without the interrupt status set.
>
> If you want then you could extend SimpleFileVisitor instead, that would
> allow you to drop the preVisitDirectory method.
>
> A passing comment on closetest/Command is that the copyFile method could
> use Files.copy with REPLACE_EXISTING.
>
> Also rm_minus_rf (amusing name) doesn't need to use isFile or
> isDirectory as FilesUtil.deleteFIleTree will do the right thing.
>
> -Alan.



More information about the core-libs-dev mailing list