RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v2]
Julia Boes
jboes at openjdk.java.net
Mon Mar 29 09:13:24 UTC 2021
On Mon, 22 Mar 2021 16:36:55 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> I guess this presumes that no reference to `headers` escapes? Can that be assumed?
>
> Yes - it's private - and that wasn't a problem before - was it? The problem was the put method that still put things into the map - and that will be taken care of if the map is unmodifiable.
Added (back) a `headers` field as per you suggestion, which is only accessed by `getFirst`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3032
More information about the net-dev
mailing list