JDK-8151296 : Remove HttpHeaders1 and make HttpHeaders thread safe
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2016-03-04
  • Updated: 2016-07-16
  • Resolved: 2016-04-05
Related Reports
Duplicate :  
Description
java.net.http.HttpHeaders1 is an implementation class but was made public by mistake. Also, the current implementation approach is not thread safe.

A better approach might be to define a new class

class HttpHeadersUnmodifiable implements HttpHeaders {
    HttpHeadersUnmodifiable(HttpHeadersImpl ) {}
}

The class should use final fields and the constructor above should populate these fields guaranteeing thread safety.
Comments
We need to integrate HTTP2 in next few days and this work has been covered by the referenced bug id.
05-04-2016