RFR: 8159055: ImageIcon.setImage can't handle null parameter [v22]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Jul 29 12:44:25 UTC 2025
On Mon, 28 Jul 2025 20:09:06 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 68:
>>
>>> 66: * no exceptions will be thrown but the image will be unset,
>>> 67: * as it will have no dimensions and never be drawn, and
>>> 68: * {@code getImageLoadStatus()} will report {@see java.awt.MediaTracker#ERRORED}.
>>
>> Suggestion:
>>
>> * {@code getImageLoadStatus()} will report {@link java.awt.MediaTracker#ERRORED}.
>>
>> You shouldn't use `@see` here, it should either be `@code` or `@link`. I think both references should use the same tag: either `@code` or `@link`; the latter allows quickly navigating to the *method* or constant.
>>
>> Perhaps, `@link` for the `getImageLoadStatus` method would work better: it allows viewing the description of the method and its purpose; in its turn, `getImageLoadStatus` references possible return values including `MediaTracker.ERRORED` with `@see` tag.
>
> Indeed, this is not supported, the generated javadoc looks like this:
>
> “…and `getImageLoadStatus()` will report .”
>
> Therefore I suggest the following:
>
>
> * {@link #getImageLoadStatus()} will report {@code MediaTracker.ERRORED}.
modified
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25767#discussion_r2239692279
More information about the client-libs-dev
mailing list