On Thu, 2 Jul 2026 16:10:30 GMT, Chris Plummer <[email protected]> wrote:

>> src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java line 102:
>> 
>>> 100:      * <div class="preview-block">
>>> 101:      *     <div class="preview-comment">
>>> 102:      *         When preview features are enabled for the target VM,
>> 
>> Dropping `@apiNote` is good as this is normative test (not an API note).
>> 
>> For the preview-block text then I'm wondering about the case where the 
>> debugger/JDI-tool is running on JDK 28 and the target VM is JDK 35. Value 
>> classes and objects should be be permanent feature by then so there is value 
>> classes and objects without needing to enable preview. Having the back end 
>> and front end be different arises a lot in IDEs.
>> 
>> I don't think it's possible to future proof completely but maybe it could 
>> say something like "If the target VM supports value classes and objects 
>> (link to JEP 401), ..." and add a note that the feature requires enabling 
>> preview features in JDK 28?  If this starts your screaming then ignore my 
>> comment, it might be okay to keep it simple for now.
>
> I see your point, but it does start to get clumsy, and as you point out, 
> completely future proofing is even more of a challenge, if even possible. 
> With your suggestion, the "preview" reference never goes away. Even in JDK 35 
> with value objects being a permanent feature, we'd need to have wording 
> indicating that preview features may need to be enabled on the target VM. Do 
> we really want that?

For reference, here are examples from JDK 19 when virtual threads were in 
preview.

https://docs.oracle.com/en/java/javase/19/docs/api/jdk.jdi/com/sun/jdi/ThreadReference.html
https://docs.oracle.com/en/java/javase/19/docs/api/jdk.jdi/com/sun/jdi/StackFrame.html

It avoided prefixing the clarifications with "When preview are enabled ..." and 
instead spoke about the feature. This works because the feature, and the 
behavior specified, didn't change in second preview or when it became a 
permanent feature in JDK 21.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2611#discussion_r3514973268

Reply via email to