RFR: 8337998: CompletionFailure in getEnclosingType attaching type annotations [v2]

Liam Miller-Cushon cushon at openjdk.org
Mon Aug 12 18:15:55 UTC 2024


> This change fixes a `CompletionFailure` crash in javac when a missing class is discovered while attaching type annotations read from a class file.
> 
> Type annotations on classes are located with a type path starting on the 'outermost part of the type for which a type annotation is admissible', so annotating a type requires knowing its outer classes, and the call to `ClassType#getEnclosingType` can cause additional symbols to be completed.
> 
> This change handles the completion failures, and reports an error diagnostic instead of the current crash.

Liam Miller-Cushon 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 six additional commits since the last revision:

 - Merge branch 'master' into JDK-8337998
 - Update diagnostic key and text to refer to 'attaching', not 'reading' type annotations
 - Update diagnostic key
 - Update not-yet list
 - Remove unused import
 - 8337998: CompletionFailure in getEnclosingType attaching type annotations

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20495/files
  - new: https://git.openjdk.org/jdk/pull/20495/files/3e19fc73..a1e7e33d

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

  Stats: 10127 lines in 304 files changed: 4001 ins; 5108 del; 1018 mod
  Patch: https://git.openjdk.org/jdk/pull/20495.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20495/head:pull/20495

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


More information about the compiler-dev mailing list