RFR: 8268960: com/sun/net/httpserver/Headers.java: Ensure mutators normalize keys and disallow null for keys and values [v3]

Julia Boes jboes at openjdk.java.net
Fri Jun 25 13:50:37 UTC 2021


On Thu, 24 Jun 2021 15:15:07 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Julia Boes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   confirm HttpExchange::sendResponseHeaders fails if key/value null
>
> src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java line 115:
> 
>> 113:     @Override
>> 114:     public boolean containsKey(Object key) {
>> 115:         Objects.requireNonNull(key);
> 
> I haven't looked at the CSR yet - but maybe the fact that the get and contains* method can now throw NPE - in conformance to the Map interface specification for maps that do not allow null keys or null values, should be explicitly mentioned - in particular in the release note - as this will probably be the less expected behavior change.

Updated CSR to better reflect this behavioural change.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4528


More information about the net-dev mailing list