RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v3]
Julia Boes
jboes at openjdk.java.net
Wed Apr 7 13:34:01 UTC 2021
On Tue, 6 Apr 2021 13:12:46 GMT, Julia Boes <jboes at openjdk.org> wrote:
>> LGTM
>
> I included a null check in the constructor to account for null values of `List<String>`, which `Headers` allows. Fixed the indentation.
>
> Testing: Tier 1-3 all clear.
It turns out I wasn't right in the last commit. The null check is not needed in the constructor, but in the `get` method, where `Headers::get` can return null, which can cause `Collections.unmodifiableList` to throw NPE. I updated the get method and added some more test cases to confirm equality of Headers and UnmodifiableHeaders instances.
Testing: Tier 1-3 all clear.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3032
More information about the net-dev
mailing list