Missing throws declaration for NullPointerException in Proxy#getInvocationHandler

Steffen Nießing zuniquex at protonmail.com
Thu May 22 18:12:17 UTC 2025


Hi,

recently I've come across the documentation of Proxy#getInvocationHandler(Object) and recognized that there's a missing throws declaration for a NullPointerException. The expression Proxy.getInvocationHandler(null) fails, because proxy.getClass() is called without asserting that proxy is not null.

I'd be happy to provide the JavaDoc update, if anyone would like to sponsor me the JBS issue for this one.

Cheers
Steffen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250522/e20ce70f/attachment.htm>


More information about the core-libs-dev mailing list