<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 05/05/2025 21:05, Steffen Nießing wrote:<br>
<blockquote type="cite" cite="mid:Osz5cwLv8dCufch8gyhKOQf-jqglf72M1rNOEiLPtWbFrQwwUNo6ump8KA3rCi5ZaTGtWiIFQgII55g50WurfP6rvKumwWyfIgGZGVwckCo=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Hello,</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 discovered that the JavaDoc of the instance methods of
java.net.http.HttpHeaders lacks the throws declarations for
NullPointerExceptions. The static creator method `of` contains
such a declaration. So the snippet `<span>HttpHeaders.of(null,
null)</span>` is documented to throw an NPE, while the snippet
`<span>HttpHeaders.of(Map.of(), (k, v) ->
true).firstValue(null)</span>` currently isn't.</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
propose to add the missing JavaDoc throws declarations to the <span>#allValues(String</span>),
<span>#firstValueAsLong(String</span>) and #<span>firstValue(String</span>)
methods as they all can throw an NPE through `<span>requireNonNull(name);`
in the allValues method</span>.</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);">If
there's interest in this change, I'd appreciate if anyone would
like to sponsor me on this one.</div>
<br>
</blockquote>
Can you bring this to net-dev to discuss? net-dev is where the
networking API and the HTTP client are maintained.<br>
<br>
-Alan<br>
</body>
</html>