Skip to content

8281238: TYPE_USE annotations not printed in correct position in toString output#4242

Open
cushon wants to merge 3 commits intoopenjdk:masterfrom
cushon:JDK-8281238
Open

8281238: TYPE_USE annotations not printed in correct position in toString output#4242
cushon wants to merge 3 commits intoopenjdk:masterfrom
cushon:JDK-8281238

Conversation

@cushon
Copy link
Contributor

@cushon cushon commented Jan 27, 2026

This backport of JDK-8281238 fixes a bug in TypeMirror#toString output when printing type annotations.

TypeMirror#toString is specified to return a string that is "suitable for representing this type in source code". This fix causes type annotations on qualified names to be printed at the correct location, for example java.lang.@Annotation String instead of @Annotation java.lang.String.

There was a bug in the initial fix for JDK-8281238, follow-on fix JDK-8284220 is included in this backport.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8281238 needs maintainer approval
  • JDK-8284220 needs maintainer approval

Issues

  • JDK-8281238: TYPE_USE annotations not printed in correct position in toString output (Bug - P3)
  • JDK-8284220: TypeMirror#toString omits enclosing class names after JDK-8281238 (Bug - P2)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4242/head:pull/4242
$ git checkout pull/4242

Update a local copy of the PR:
$ git checkout pull/4242
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4242/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4242

View PR using the GUI difftool:
$ git pr show -t 4242

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4242.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 27, 2026

👋 Welcome back cushon! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 27, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 4032fe76dccb6da85927361aee7ceedcdb758e89 8281238: TYPE_USE annotations not printed in correct position in toString output Jan 27, 2026
@openjdk
Copy link

openjdk bot commented Jan 27, 2026

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport Port of a pull request already in a different code base label Jan 27, 2026
@cushon cushon marked this pull request as ready for review January 27, 2026 10:31
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 27, 2026
@cushon
Copy link
Contributor Author

cushon commented Jan 27, 2026

/issue add JDK-8284220

@openjdk
Copy link

openjdk bot commented Jan 27, 2026

@cushon
Adding additional issue to issue list: 8284220: TypeMirror#toString omits enclosing class names after JDK-8281238.

@mlbridge
Copy link

mlbridge bot commented Jan 27, 2026

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant