RFR: 8023113: tools/jar/ChangeDir.java fails if /tmp/a exists
xueming.shen at oracle.com
Thu Sep 19 16:53:36 UTC 2013
On 9/19/2013 1:52 AM, Alan Bateman wrote:
> On 18/09/2013 20:45, Xueming Shen wrote:
>> OK, how about this one? I'm even using lambda:-)
> Looks okay except that Files.list returns a stream that needs to be closed to avoid leaking resources.
agreed we had enough fun already here.
> As a side note, as cleanup is attempting to delete a file tree then you could eliminate the recursion by using Files.walkFileTree with the directories removed in the postVisitDirectory method. It might be tempting to use the new walk method but it returns each directory before its entries and so isn't appropriate for recursive ops where you need to do touch the directory after its entries. I'm not suggesting spending any more time on this test of course, you've done more than enough.
More information about the core-libs-dev