RFR: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable [v2]

Michael McMahon michaelm at openjdk.java.net
Mon Mar 29 13:31:27 UTC 2021


On Mon, 29 Mar 2021 09:09:00 GMT, Julia Boes <jboes at openjdk.org> wrote:

>> The fix makes the map in sun.net.httpserver.UnmodifiableHeaders unmodifiable by wrapping it in an unmodifiable view.
>
> Julia Boes has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - wrap List<String> with unmodifiable map and update test
>  - remove map wrapping

Changes requested by michaelm (Reviewer).

src/jdk.httpserver/share/classes/sun/net/httpserver/UnmodifiableHeaders.java line 34:

> 32: public class UnmodifiableHeaders extends Headers {
> 33: 
> 34:     private final Headers headers;

Could you add a comment here that Headers is mutable, but no reference to it escapes.

Also, can you fix the indentation of the other existing methods.

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

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


More information about the net-dev mailing list