On Mon, 13 Jul 2026 00:50:42 GMT, Chris Plummer <[email protected]> wrote:

>> src/jdk.jdi/share/classes/com/sun/jdi/ObjectReference.java line 58:
>> 
>>> 56:  *      <div class="preview-comment">
>>> 57:  * <h2><a id=valueObjects>Value Objects</a></h2>
>>> 58:  * When preview features are enabled, JDI supports value objects and 
>>> classes
>> 
>> This whole paragraph seems excessive when there is nothing special to say 
>> about value objects here. You shouldn't have to say that JDI follows JLS and 
>> JVMS as that is a given, except where otherwise noted.
>
> It's not a given. JDI does not implement the Java language nor a Java Virtual 
> Machine, so it is not beholden to either spec. References to the JLS and JVMS 
> (which already exist in the JDI javadoc) are used in places to aid in 
> specifying JDI behavior.

Not sure what "beholden to the spec" actually means in this context, but to say 
JDI value object support is "consistent with JLS/JVMS" really doesn't tell you 
anything IMO. The main point here is simply that you can obtain an 
`ObjectReference` for a value object, just like any identity object. The only, 
very important, difference, is that it is a snapshot of the value object at 
that point in time. And whilst the value object is immutable, different 
ObjectReferences obtained during construction could capture different 
initalization states.

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2639#discussion_r3567711422

Reply via email to