<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello, I have created <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-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
P.S. In the future, you can also report bugs via <a href="https://bugs.java.com/">
https://bugs.java.com/</a></div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regard, Chen</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Steffen Nießing <zuniquex@protonmail.com><br>
<b>Sent:</b> Thursday, May 22, 2025 1:12 PM<br>
<b>To:</b> core-libs-dev@openjdk.org <core-libs-dev@openjdk.org><br>
<b>Subject:</b> Missing throws declaration for NullPointerException in Proxy#getInvocationHandler</font>
<div> </div>
</div>
<div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hi,</div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); 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>Proxy.getInvocationHandler(null)</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; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); 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; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Cheers</div>
<div style="font-family:Arial,sans-serif; font-size:14px; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Steffen</div>
</div>
</body>
</html>