RFR 8011719: Properties.loadFromXML fails with a chunked HTTP connection

Michael McMahon michael.x.mcmahon at oracle.com
Tue Jun 4 10:13:05 PDT 2013


On 31/05/13 15:39, Chris Hegarty wrote:
> HttpURLConnection returns various input streams, depending on the 
> response from the server. fixed content-length, chunked, error. Most, 
> if not all, are wrapped in an implementation specific HttpInputStream, 
> to correctly handle caching of responses. The issue reported by 
> 8011719 is that the close method of HttpInputStream throws an 
> IOException if called multiple times. The solution is to add a private 
> boolean to HttpInputStream to indicate whether the stream has been 
> closed, or not. This is very typical of these type of wrapper streams.
>
> Also worth noting, the stream cannot be marked closed until near the 
> end of its close() method, since it needs to invoke read itself. 
> Should not be a problem as these streams are not thread-safe.
>
> http://cr.openjdk.java.net/~chegar/8011719/webrev.00/webrev/
>
> A test has been added to ensure correct behavior of the various 
> combinations of returned input streams.
>
> -Chris.

Looks good. Seems to be quite a comprehensive test

Thanks
Michael.



More information about the net-dev mailing list