RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]
robert engels
duke at openjdk.org
Fri May 3 13:27:54 UTC 2024
On Fri, 3 May 2024 13:17:43 GMT, Ethan McCue <duke at openjdk.org> wrote:
>> robert engels has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into HttpExchange-api-change
>>
>> # Conflicts:
>> # src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
>> - update api changes based on comments
>
> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java line 82:
>
>> 80: * @see #sendResponseHeaders(int, long)
>> 81: * */
>> 82: public static final long CHUNKED_CONTENT = 0L;
>
> I feel a little uneasy about these constant names, if only because the parameter they are intended to be used for is called "`responseLength`"
>
> "The response length is chunked content." Feels strange. Really you don't know the response length. Perhaps `responseLength` is what should change?
That is why the new methods were added. Hard to fix this and remain backward compatible. This will allow an automated change to the constants for better readability.
It is still a length - it’s that some length values are sentinels
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18955#discussion_r1589197403
More information about the net-dev
mailing list