RFR: 8338815: Add separation to exception message in JavacFileManager.DirectoryContainer

Eirik Bjørsnøs eirbjo at openjdk.org
Thu Aug 22 08:36:13 UTC 2024


Please review this trivial PR which injects a `": "` separator between the directory name and the exeption toString when constructing the IOException message in `JavacFileManager.DirectoryContainer.list`.

This changes the javac error message from:

`error accessing directory Z:\invalid-pathjava.nio.file.InvalidPathException: Illegal char <:> at index 4: file:txt`

into:

`error accessing directory Z:\invalid-path: java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:txt`

We could alternatively use some other separator, such as a `", "`.

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

Commit messages:
 - Add separation between directory name and InvalidPathException toString in DirectoryContainer.list

Changes: https://git.openjdk.org/jdk/pull/20673/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20673&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338815
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/20673.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20673/head:pull/20673

PR: https://git.openjdk.org/jdk/pull/20673


More information about the compiler-dev mailing list