On Fri, 24 Sep 2021 17:00:14 GMT, Jonathan Gibbons <[email protected]> wrote:

>> Please review a moderately simple update to convert JavadocTester to just 
>> use NIO, instead of a mix of File and NIO.
>> 
>> The original code used java.io.File. At some point (JDK 9-ish) new code was 
>> added that used NIO, resulting in a mix. This change converts the old code 
>> to use NIO as well.
>> 
>> This is mostly internal, with two changes that affect tests.
>> 
>> 1. The `protected` field `outputDir` is changed from a `File` to a `Path`.   
>> Some tests use `outputDir` directly, typically to convert it to a `Path`.
>> 2. The `copyDir` method had a strange spec.  Partly, it used "target" to 
>> describe the directory being copied, but worse, it copied the entire source 
>> directory INTO the destination directory, as compared to copying the 
>> contents.  The method was just used in a single test, so I've changed the 
>> spec of the method and the use in the test.  This cleaned up a "TODO" as 
>> well, to use `Files.walkFileTree` for the copy.
>
> Jonathan Gibbons has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains four commits:
> 
>  - Simplify ToolBox.copyDir
>    Revert bad IDE suggestion
>  - Merge with upstream/master
>  - Address review comments;
>    Move `JavadocTester.copyDir` to `ToolBox`; use FileVisitor code
>  - JDK-8274172: Convert JavadocTester to use NIO

test/langtools/tools/lib/toolbox/ToolBox.java line 277:

> 275:             if (toDir.getParent() != null) {
> 276:                 Files.createDirectories(toDir.getParent());
> 277:             }

This is exactly what I was going to re-suggest after I read your reply on my 
initial suggestion. We're on the same page. Thanks for simplifying this stuff.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5644

Reply via email to