RFR: 8253005: Add `@throws IOException` in javadoc for `HttpEchange.sendResponseHeaders` [v7]
Daniel Fuchs
dfuchs at openjdk.java.net
Thu Nov 5 17:26:56 UTC 2020
On Thu, 5 Nov 2020 17:08:10 GMT, Patrick Concannon <pconcannon at openjdk.org> wrote:
>> Hi,
>>
>> Could someone please review my fix for JDK-8253005: 'Add `@throws IOException` in javadoc for `HttpEchange.sendResponseHeaders`' ?
>>
>> The method `HttpEchange.sendResponseHeaders` throws an `IOException` but is unspecified in its javadoc. This fix adds an `@throws IOException` to its specification and a description of the conditions under which the exception is thrown.
>>
>> Kind regards,
>> Patrick
>
> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision:
>
> 8252304: Added read to TestHandler to ensure requestBody consumed before closing exchange
Changes requested by dfuchs (Reviewer).
test/jdk/java/net/httpclient/SendResponseHeadersTest.java line 99:
> 97: // unexpected exception thrown, return error to client
> 98: t.printStackTrace();
> 99: os.write(("Unexpected error: " + t).getBytes());
This should be:
os.write(("Unexpected error: " + t).getBytes(StandardCharsets.UTF_8));
test/jdk/java/net/httpclient/SendResponseHeadersTest.java line 94:
> 92: try {
> 93: IOException io = expectThrows(IOException.class,
> 94: () -> exchange.sendResponseHeaders(200, "failMsg".getBytes().length));
It would be clearer to use a constant value here: either 0, or some meaningless value > 0 and < 16
-------------
PR: https://git.openjdk.java.net/jdk/pull/1014
More information about the net-dev
mailing list