Skip to content

8381439: [lworld] Extends random values tests to value containers#2291

Closed
fparain wants to merge 5 commits intoopenjdk:lworldfrom
fparain:rnd_container_tests
Closed

8381439: [lworld] Extends random values tests to value containers#2291
fparain wants to merge 5 commits intoopenjdk:lworldfrom
fparain:rnd_container_tests

Conversation

@fparain
Copy link
Copy Markdown
Collaborator

@fparain fparain commented Mar 31, 2026

This patch adds a new test with identity objects containing values from randomly generated values classes.
The test checks field accesses through bytecodes and through reflection, and also some layout verification.
The ValueClassGenerator has been extended to generate LooselyConsistent annotated values classes, as well as null-restricted fields (automatically used by previous tests using the ValueClassGenerator).
The patch also includes various cleanup in the ValueClassGenerator and related test files.

This patch contains the fix for JDK-8381213 (this bug was preventing some of the new tests from passing).

New and updated tests have been tested on Mach5 (all standard platforms).

Thanks,

Fred


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-8381439: [lworld] Extends random values tests to value containers (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2291

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 31, 2026

👋 Welcome back fparain! 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
Copy link
Copy Markdown

openjdk bot commented Mar 31, 2026

@fparain 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:

8381439: [lworld] Extends random values tests to value containers

Reviewed-by: phubner

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 142 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 Mar 31, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 31, 2026

Webrevs

Copy link
Copy Markdown
Member

@Arraying Arraying left a comment

Choose a reason for hiding this comment

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

Thanks! This is something that is very valuable to have. The changes seem fine, I'm just concerned about a possibly non-terminating loop. Otherwise minor comments.

Asserts.assertEquals(v, <value_class_name>.getPredefinedValue(3));

// Testing field nrv
npe = null;
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.

Nit: redundant. Also subsequent usages.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

They are intentionally redundant, so we can change individual tests or insert a new one without having to care about the status of this variable. I've considered put each test in an individual method, but it adds a lot of boilerplate for not a lot of benefits.

c.testFieldsViaReflection();
}

void testFields() {
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.

Is there a reason that you check for nullability of the exceptions? I think using the Assertions::assertDoesNotThrow​ would be more robust and reduces code size significantly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The tests are not using JUnit.

Copy link
Copy Markdown
Member

@Arraying Arraying left a comment

Choose a reason for hiding this comment

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

The changes since last review look good, thank you!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 8, 2026
@fparain
Copy link
Copy Markdown
Collaborator Author

fparain commented Apr 8, 2026

Thanks @Arraying for the review.
/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 8, 2026

Going to push as commit 13de33a.
Since your change was applied there have been 143 commits pushed to the lworld branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 8, 2026
@openjdk openjdk bot closed this Apr 8, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 8, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 8, 2026

@fparain Pushed as commit 13de33a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

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

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants