RFR: 8337998: CompletionFailure in getEnclosingType attaching type annotations

Liam Miller-Cushon cushon at openjdk.org
Wed Aug 7 22:18:05 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.

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

Commit messages:
 - Update not-yet list
 - Remove unused import
 - 8337998: CompletionFailure in getEnclosingType attaching type annotations

Changes: https://git.openjdk.org/jdk/pull/20495/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20495&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8337998
  Stats: 115 lines in 4 files changed: 112 ins; 0 del; 3 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