Skip to content

8384068: [lworld] ValueClassPlugin misses some annotations#2405

Open
xmas92 wants to merge 5 commits into
openjdk:lworldfrom
xmas92:lworld-improve-ValueClassPlugin
Open

8384068: [lworld] ValueClassPlugin misses some annotations#2405
xmas92 wants to merge 5 commits into
openjdk:lworldfrom
xmas92:lworld-improve-ValueClassPlugin

Conversation

@xmas92

@xmas92 xmas92 commented May 7, 2026

Copy link
Copy Markdown
Member

There are few places which uses the fully qualified name for the AsValueClass annotation. As a result the plugging does not modify these classes when compiling, so they are still identity classes.

I propose improving the robustness of this plugin. We need to do this during parsing so we cannot actually check 100% that it will resolve to the correct annotation. However we can do a best effort, which handles same package, fully qualified, imported and rejects other annotations with the same class name.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8384068: [lworld] ValueClassPlugin misses some annotations (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2405/head:pull/2405
$ git checkout pull/2405

Update a local copy of the PR:
$ git checkout pull/2405
$ git pull https://git.openjdk.org/valhalla.git pull/2405/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2405

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2405.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented May 7, 2026

Copy link
Copy Markdown

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

@openjdk

openjdk Bot commented May 7, 2026

Copy link
Copy Markdown

@xmas92 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8384068: [lworld] ValueClassPlugin misses some annotations

Reviewed-by: jsikstro, jsjolen

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 14 new commits pushed to the lworld branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 7, 2026
@mlbridge

mlbridge Bot commented May 7, 2026

Copy link
Copy Markdown

Webrevs

@xmas92

xmas92 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Just a friendly ping.

The only tests that are currently being affected is gc/stress/gcbasher. So we are missing some EnablePreview testing here. Would be nice to get this in both for test coverage and to ensure that we do not miss future uses of @jdk.test.lib.valueclass.AsValueClass.

@jsikstro jsikstro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going in the right direction. One question:

What if we have a case like below, that will match as true when it shouldn't. But I guess that's rare/bad code.

package jdk.test.lib.valueclass;

import other.AsValueClass;

@AsValueClass
public final class ShadowInSamePackage {}

@jsikstro jsikstro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not my area, but I think the revised logic around checking for the AsValueClass annotation is sound and seem to slot it nicely with the surrounding code.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jun 10, 2026

@johan-sjolen johan-sjolen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should obviously be done at semantic analysis-time (well, post-semantic analysis-time). I don't get why it has to be done at parse time, but OK, if you say so then I believe you. Besides, this is an improvement.

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

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants