RFR: JDK-8274172: Convert JavadocTester to use NIO [v2]

Jonathan Gibbons jjg at openjdk.java.net
Thu Sep 23 17:15:46 UTC 2021


> 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 incrementally with one additional commit since the last revision:

  Address review comments;
  Move `JavadocTester.copyDir` to `ToolBox`; use FileVisitor code

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5644/files
  - new: https://git.openjdk.java.net/jdk/pull/5644/files/e858981c..6413a60f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5644&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5644&range=00-01

  Stats: 109 lines in 3 files changed: 56 ins; 44 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5644.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5644/head:pull/5644

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


More information about the javadoc-dev mailing list