United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7054199 : Need to review plugin cached JarURLConnection.getURL during redirect

Details
Type:
Enhancement
Submit Date:
2011-06-13
Status:
Closed
Updated Date:
2011-10-12
Project Name:
JDK
Resolved Date:
2011-10-12
Component:
deploy
OS:
generic
Sub-Component:
deployment_toolkit
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7u2 (b08)

Related Reports
Backport:

Sub Tasks

Description
URLConnection should behave not identically but largely compatibly regardless of whether the resource is cached or not. The caching should largely be invisible to the callers of URLConnection. Yet while debugging redirect case with plugin and webstart, I can see that there is difference in returned value of URLConnection.getURL() b/w cached and non-cached.

The reason in the code.  HttpURLConnection.getInputStream(), connect() was called which would eventually access CacheResponse.get() and set cachedInputStream.   Because of this, followRedirect() is not called and the url field would not get the final url value.  The same with CachedJarURLConnection implementation.

Note: it is important any change to the above implementations of getURL() should not break client (applet/application) code.

                                    

Comments
EVALUATION

Fixed by overriding getURL() and getJarFileURL() methods of CachedJarURLConnection and JNLPCachedJarURLConnection.

Pushed to 7u with changeset:
http://closedjdk.us.oracle.com/jdk7u/deploy/deploy/rev/a5ac40c3e41a
                                     
2011-09-19



Hardware and Software, Engineered to Work Together