On Tue, 16 Jun 2026 06:36:41 GMT, Chen Liang <[email protected]> wrote:
>> Hello Alan, my comment was more in terms of readability to make it clear at >> this call site that the identity requirement is only applicable when preview >> features is enabled. I don't have a strong preference and it's OK to retain >> it in the current form. > > On the contrary, I would argue for making requireIdentity a reflective > preview API - this requirement makes sense for programs running out of > preview too, that they want something with a monitor instead of null or new > kinds of monitorless objects. I wonder if Roger has any notes on "why" the requireIdentity methods are normal preview, and this one is a reflective preview API. If there are frameworks or library looking to have early support for value classes they might need want to use requireIdentity. When virtual threads were in preview then we noticed the frameworks were accessing the preview API reflectively (as they want to build/run across a range of releases) and thus it didn't matter if the API was normal or reflective preview. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3418913575
