On Wed, 2 Dec 2026 06:20:24 GMT, xiaotaonan <[email protected]> wrote:

>> The JDI `Type` and `Value` Javadocs incorrectly list `VoidType` and 
>> `VoidValue` under "Subinterfaces of `PrimitiveType`" and "Subinterfaces of 
>> `PrimitiveValue`", respectively.
>> 
>> However, `VoidType` and `VoidValue` directly extend `Type` and `Value`, not 
>> `PrimitiveType` or `PrimitiveValue`. This is confirmed by the interface 
>> declarations and by historical behavior (e.g., JDK-6431735, where casting 
>> `VoidTypeImpl` to `PrimitiveTypeImpl` throws `ClassCastException`).
>> 
>> This fix:
>> - Removes `VoidType` from the `PrimitiveType` subinterface table in 
>> `Type.java`.
>> - Removes `VoidValue` from the `PrimitiveValue` subinterface table in 
>> `Value.java`.
>> - Adds a short statement in both files clarifying that 
>> `VoidType`/`VoidValue` directly extend `Type`/`Value`.
>> - Updates the copyright headers.
>> 
>> Testing:
>> - Doc-only change; no code behavior modified. Built the docs and verified 
>> the updated Javadoc renders correctly.
>> 
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> xiaotaonan has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fix: Modify according to the review comments.

The VoidValue and VoidType descriptions still refer to these types as 
representing the "primitive" void value or type. For example, in VoidValue it 
says:

> Provides access to a primitive void value in the target VM.

"primitive" should no longer be used.  Also, you might want to mention that 
Method.returnType() returns VoidType when the return type is void, and that 
VoidValue is used to represent a void return value.

src/jdk.jdi/share/classes/com/sun/jdi/Value.java line 121:

> 119:  * <p>
> 120:  * The {@code void} value is mirrored by {@link VoidValue}, which 
> directly
> 121:  * extends {@code value} and is not a subinterface of {@link 
> PrimitiveValue}.

I think the "value" reference should be "Value":

Suggestion:

 * extends {@link Value} and is not a subinterface of {@link PrimitiveValue}.

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

Changes requested by cjplummer (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/34155#pullrequestreview-6157992824
PR Review Comment: https://git.openjdk.org/jdk/pull/34155#discussion_r4775246405

Reply via email to