RFR [9] 8175261: Per-protocol setting for not working for JAR URLConnection defaultUseCaches

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR [9] 8175261: Per-protocol setting for not working for JAR URLConnection defaultUseCaches

Chris Hegarty
The fix for 8163449 [1] "Allow per protocol setting for URLConnection
defaultUseCaches", does not work for JAR URLs ( which embed URLs to
the actual artifact ).

The problem is that sun.net.www.protocol.jar.JarURLConnection passes
all of the [g|s]et[Default]UseCaches() method calls to the embedded
jar file URLConnection. This means any attempt to control caching for
just JAR URLs fails. "jar" always ends up being treated like whatever
the embedded URL is, which is exactly the case that 8163449 was trying
to address.

JarURLConnection should set the initial cache value of its emdedded
URLConnection ( to the actual resource ), to whatever its initial
value is. Subsequent set/getUseCaches will then behave as expected.

http://cr.openjdk.java.net/~chegar/8175261.00/
https://bugs.openjdk.java.net/browse/JDK-8175261

-Chris

[1] https://bugs.openjdk.java.net/browse/JDK-8163449
Reply | Threaded
Open this post in threaded view
|

Re: RFR [9] 8175261: Per-protocol setting for not working for JAR URLConnection defaultUseCaches

Michael McMahon
Looks good Chris.

- Michael.

On 20/02/2017, 16:14, Chris Hegarty wrote:

> The fix for 8163449 [1] "Allow per protocol setting for URLConnection
> defaultUseCaches", does not work for JAR URLs ( which embed URLs to
> the actual artifact ).
>
> The problem is that sun.net.www.protocol.jar.JarURLConnection passes
> all of the [g|s]et[Default]UseCaches() method calls to the embedded
> jar file URLConnection. This means any attempt to control caching for
> just JAR URLs fails. "jar" always ends up being treated like whatever
> the embedded URL is, which is exactly the case that 8163449 was trying
> to address.
>
> JarURLConnection should set the initial cache value of its emdedded
> URLConnection ( to the actual resource ), to whatever its initial
> value is. Subsequent set/getUseCaches will then behave as expected.
>
> http://cr.openjdk.java.net/~chegar/8175261.00/
> https://bugs.openjdk.java.net/browse/JDK-8175261
>
> -Chris
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8163449
Reply | Threaded
Open this post in threaded view
|

Re: RFR [9] 8175261: Per-protocol setting for not working for JAR URLConnection defaultUseCaches

Daniel Fuchs
In reply to this post by Chris Hegarty
Hi Chris,

Looks good to me as well.

cheers,

-- daniel

On 20/02/17 16:14, Chris Hegarty wrote:

> The fix for 8163449 [1] "Allow per protocol setting for URLConnection
> defaultUseCaches", does not work for JAR URLs ( which embed URLs to
> the actual artifact ).
>
> The problem is that sun.net.www.protocol.jar.JarURLConnection passes
> all of the [g|s]et[Default]UseCaches() method calls to the embedded
> jar file URLConnection. This means any attempt to control caching for
> just JAR URLs fails. "jar" always ends up being treated like whatever
> the embedded URL is, which is exactly the case that 8163449 was trying
> to address.
>
> JarURLConnection should set the initial cache value of its emdedded
> URLConnection ( to the actual resource ), to whatever its initial
> value is. Subsequent set/getUseCaches will then behave as expected.
>
> http://cr.openjdk.java.net/~chegar/8175261.00/
> https://bugs.openjdk.java.net/browse/JDK-8175261
>
> -Chris
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8163449