<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div>On May 22, 2025, at 1:06 PM, Chen Liang <chen.l.liang@oracle.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt;">
Hello, I have created<span class="Apple-converted-space"> </span><a href="https://bugs.openjdk.org/browse/JDK-8357597">https://bugs.openjdk.org/browse/JDK-8357597</a> for this.</div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt;">
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.</div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt;">
P.S. In the future, you can also report bugs via<span class="Apple-converted-space"> </span><a href="https://bugs.java.com/">https://bugs.java.com/</a></div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt;">
<br>
</div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt;">
Regard, Chen</div>
<div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
</div>
<hr tabindex="-1" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 784px;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"></span>
<div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Steffen Nießing <zuniquex@protonmail.com><br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Thursday, May 22, 2025 1:12 PM<br>
<b>To:</b><span class="Apple-converted-space"> </span>core-libs-dev@openjdk.org <core-libs-dev@openjdk.org><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Missing throws declaration for NullPointerException in Proxy#getInvocationHandler</font>
<div> </div>
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
Hi,</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
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<span class="Apple-converted-space"> </span><span>Proxy.getInvocationHandler(null)</span><span class="Apple-converted-space"> </span>fails,
 because proxy.getClass() is called without asserting that proxy is not null.</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
I'd be happy to provide the JavaDoc update, if anyone would like to sponsor me the JBS issue for this one.</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
Cheers</div>
<div style="font-family: Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">
Steffen</div>
</div>
</div>
</blockquote>
</div>
<br>
</body>
</html>