RFR: 8200610: Compiling fails with java.nio.file.ReadOnlyFileSystemException [v3]

Archie L. Cobbs duke at openjdk.org
Thu Dec 8 02:22:23 UTC 2022


> In `JavaCompiler`, when trying to write a class file, if an `IOException`s is thrown, instead of crashing, we report a normal error" `error while writing [file]: ...`.
> 
> However there are some I/O errors that can generate `RuntimeException`s not caught by this logic. So instead these errors cause a compiler crash.
> 
> An example is given in JDK-8200610, where the compiler tries to write into a ZIP file system and a `java.nio.file.ReadOnlyFileSystemException` is thrown.
> 
> This patch adds that exception and a couple of others which (in my estimation) could reasonably be expected to be thrown in various obscure cases involving alternative file systems: `FileSystemNotFoundException` and `InvalidPathException`.
> 
> Any suggestions on what the most appropriate list of exception types to include here are appreciated.

Archie L. Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' into JDK-8200610
 - Address review items (add UncheckedIOException and reformat).
 - Merge branch 'master' into JDK-8200610
 - Catch and report some java.nio.file.* exceptions along with IOException.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10818/files
  - new: https://git.openjdk.org/jdk/pull/10818/files/ecdd8b55..1bcf9501

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10818&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10818&range=01-02

  Stats: 121257 lines in 1930 files changed: 59528 ins; 42127 del; 19602 mod
  Patch: https://git.openjdk.org/jdk/pull/10818.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10818/head:pull/10818

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


More information about the compiler-dev mailing list