JDK-7054199 : Need to review plugin cached JarURLConnection.getURL during redirect
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-13
  • Updated: 2013-09-12
  • Resolved: 2011-10-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
7u2 b08Fixed 8Fixed
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.