RFR: 8022213 Intermittent test failures in java/net/URLClassLoader (Add jdk/testlibrary/FileUtils.java)
Alan Bateman
Alan.Bateman at oracle.com
Thu Nov 7 13:24:12 UTC 2013
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