I think Steffen is almost certainly right that this was an accidental omission. That omission results in the `@throws IAE` line being *interpreted* as also applying to null, but I doubt it was ever meant that way.
I think adding a `@throws NPE` is the right fix, and makes the class more consistent, and also preserves the ability to migrate the argument type to `Object!` in the future. On May 22, 2025, at 1:06 PM, Chen Liang <chen.l.li...@oracle.com> wrote: Hello, I have created https://bugs.openjdk.org/browse/JDK-8357597 for this. Your analysis isn't quite correct - if you look at the method documentation, you would anticipate this to fail with an IllegalArgumentException instead of a NullPointerException. However, this mismatch has been there since 2006, so it's best to update the docs to match the actual longstanding behavior. P.S. In the future, you can also report bugs via https://bugs.java.com/ Regard, Chen ________________________________ From: core-libs-dev <core-libs-dev-r...@openjdk.org> on behalf of Steffen Nießing <zuniq...@protonmail.com> Sent: Thursday, May 22, 2025 1:12 PM To: core-libs-dev@openjdk.org <core-libs-dev@openjdk.org> Subject: Missing throws declaration for NullPointerException in Proxy#getInvocationHandler 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