RFR: 8159055: ImageIcon.setImage can't handle null parameter [v22]
Alexey Ivanov
aivanov at openjdk.org
Mon Jul 28 19:47:05 UTC 2025
On Mon, 28 Jul 2025 19:13:23 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> ArgType name change
>
> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 186:
>
>> 184: * @param location the URL for the image
>> 185: * @param description a brief textual description of the image
>> 186: * @throws {@code NullPointerException} if (@code null) URL is passed.
>
> Suggestion:
>
> * @throws NullPointerException if a {@code null} URL is passed
>
> The exception type is automatically rendered in monospaced font with a link to its description.
>
> You meant to use braces instead of parentheses.
>
> Usually, there's no full stop for `@throws`.
>
> Alternatively, specify the parameter name for more clarity:
> Suggestion:
>
> * @throws NullPointerException if {@code location} is {@code null}
Indeed, `@throws {@code NullPointerException}` is an invalid syntax — the build fails.
…/src/java.desktop/share/classes/javax/swing/ImageIcon.java:186: error: unexpected text
* @throws {@code NullPointerException} if (@code null) URL is passed.
^
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25767#discussion_r2237672905
More information about the client-libs-dev
mailing list