[jdk17u-dev] RFR: 8342934: TYPE_USE annotations printed with error causing "," in toString output

Liam Miller-Cushon cushon at openjdk.org
Tue Jan 27 10:46:35 UTC 2026


This backport of [JDK-8342934](https://bugs.openjdk.org/browse/JDK-8342934) fixes a bug in `TypeMirror#toString` output when printing types with multiple type annotations.

`TypeMirror#toString` is specified to return a string that is "suitable for representing this type in source code". This fix causes types with multiple annotations to be printed with a space separated list of annotations, instead of using `,`, which would not be valid Java source. For example `java.lang. at A @B String` instead of `java.lang. at A, at B String`.

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

Depends on: https://git.openjdk.org/jdk17u-dev/pull/4242

Commit messages:
 - Backport ff165f9f0cf519144d7361b766bcce53d04c518e

Changes: https://git.openjdk.org/jdk17u-dev/pull/4243/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=4243&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342934
  Stats: 8 lines in 3 files changed: 4 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk17u-dev/pull/4243.diff
  Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/4243/head:pull/4243

PR: https://git.openjdk.org/jdk17u-dev/pull/4243


More information about the jdk-updates-dev mailing list