valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

8346307: [lworld] Clarify identity vs value in Class, Objects, and document limitations of value objects

Open RogerRiggs opened this issue 10 months ago • 8 comments
trafficstars

Add APINote and javadoc for IdentityException where it will be useful to know that identity or value objects are treated differently. Simplified WeakHashMap javadoc updates for IdentityException. Added note to System.identityHashCode to include value objects. Added to class javadoc for IdentityHashMap for value objects.


Progress

  • [x] Change must not contain extraneous whitespace

Issue

  • JDK-8346307: [lworld] Clarify identity vs value in Class, Objects, and document limitations of value objects (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1327

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

Using diff file

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

Using Webrev

Link to Webrev Comment

RogerRiggs avatar Jan 06 '25 20:01 RogerRiggs

:wave: Welcome back rriggs! 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.

bridgekeeper[bot] avatar Jan 06 '25 20:01 bridgekeeper[bot]

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

8346307: [lworld] Clarify identity vs value in Class, Objects, and document limitations of value objects

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 2 new commits pushed to the lworld branch:

  • a565d8bee48e4cf6bbcbb7e360c94a05fed02e3f: 8359345: [lworld] C2 crashes with -XX:ForceNonTearable=*
  • 051283b610d1b49446bb3838e7c4c9d87c8616cd: 8360530: [lworld] CDS does not preload classes listed in the LoadableDescriptors attribute

Please see this link for an up-to-date comparison between the source branch of this pull request and 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[bot] avatar Jan 06 '25 20:01 openjdk[bot]

⚠️ @RogerRiggs This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

openjdk[bot] avatar Jan 13 '25 22:01 openjdk[bot]

@RogerRiggs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Feb 03 '25 20:02 bridgekeeper[bot]

Does this intend to wait for openjdk/jdk#23395 or will it migrate from HTML after the taglet is available?

liach avatar Feb 04 '25 17:02 liach

I've been trying out the various incarnations of the javadoc support to see how they work, but that can be a separate PR when it settles.

RogerRiggs avatar Feb 04 '25 20:02 RogerRiggs

@RogerRiggs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Mar 19 '25 23:03 bridgekeeper[bot]

@RogerRiggs This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Apr 17 '25 00:04 bridgekeeper[bot]

/open Will merge and update

RogerRiggs avatar Apr 17 '25 19:04 RogerRiggs

/open

RogerRiggs avatar Apr 17 '25 19:04 RogerRiggs

@RogerRiggs This pull request is now open

openjdk[bot] avatar Apr 17 '25 19:04 openjdk[bot]

@RogerRiggs This pull request is already open

openjdk[bot] avatar Apr 17 '25 19:04 openjdk[bot]

@RogerRiggs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar May 15 '25 21:05 bridgekeeper[bot]

PreviewNote isn't merged yet; we can revisit this one once that taglet is available here.

liach avatar May 16 '25 16:05 liach

The PreviewNote tag has been delayed, the plan is to integrate these changes until it settles down.

RogerRiggs avatar May 29 '25 21:05 RogerRiggs

This is still incorrect:

Unless Preview is enabled, there is no such thing as a value class (according to the spec). Until JEP 401 is enabled, all classes are identity classes. So it would be incorrect to report that primitive classes, interfaces, and void.class are value classes.

RogerRiggs avatar Jun 20 '25 20:06 RogerRiggs

We should document explicitly that all classes, including primitives and void, are considered identity when preview features are not enabled.

liach avatar Jun 25 '25 22:06 liach

We should document explicitly that all classes, including primitives and void, are considered identity when preview features are not enabled.

Primitives and void are not classes and never have identity. The primitive wrappers and Void are classes have identity if that's what you're meaning. Interface classes never have identity (do not have ACC_SUPER/ACC_IDENTITY).
Interface classes with --enable-preview are reported as value classes.

RogerRiggs avatar Jun 26 '25 16:06 RogerRiggs

If there are no more comments, I'll push this into Valhalla tomorrow.

RogerRiggs avatar Jul 01 '25 19:07 RogerRiggs

/integrate

RogerRiggs avatar Jul 02 '25 19:07 RogerRiggs

Going to push as commit 6541b8be1d4c44245cdd62f85a7d7e943b084140. Since your change was applied there have been 4 commits pushed to the lworld branch:

  • ed13d1fab2f96f46c203fb0c20f54333c1c38b84: 8329234: [lworld] compiler/gcbarriers/TestZGCBarrierElision.java fails after JDK-8329205
  • 01af2b48708ca67e8bd9bea74b78bed6e2c2a180: 8336003: [lworld] TestLWorld::test151 triggers "Should have been buffered" assert
  • a565d8bee48e4cf6bbcbb7e360c94a05fed02e3f: 8359345: [lworld] C2 crashes with -XX:ForceNonTearable=*
  • ... and 1 more: https://git.openjdk.org/valhalla/compare/81fbc4147fe1184dc870208b8d73b6c057861119...lworld

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jul 02 '25 19:07 openjdk[bot]

@RogerRiggs Pushed as commit 6541b8be1d4c44245cdd62f85a7d7e943b084140.

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

openjdk[bot] avatar Jul 02 '25 19:07 openjdk[bot]