RFR 7133367: ResponseCache.put should not be called when setUseCaches(false)

Michael McMahon michael.x.mcmahon at oracle.com
Thu Feb 9 13:55:08 PST 2012


On 08/02/12 21:07, chris hegarty wrote:
> This seems to be an oversight in HttpURLConnection where the 
> system-wide ResponseCache handler is used to store responses even if 
> getUsesCaches returns false.
>
> I guess this was never really noticed before since the cached response 
> will not be used if getUsesCaches returns false for future requests.
>
> The solution is to check if (cacheHandler != null && getUsesCaches()), 
> similar to what is done during connect/plainConnect().
>
> http://cr.openjdk.java.net/~chegar/7133367/webrev.00/webrev/
>
> Thanks,
> -Chris.
Looks good.

- Michael



More information about the net-dev mailing list