JDK-8151542 : URL resources for multi-release jar files have a #runtime fragment appended to them
  • Type: Enhancement
  • Component: core-libs
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-09
  • Updated: 2016-06-17
  • Resolved: 2016-05-04
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 Availability Release.

To download the current JDK release, click here.
JDK 9
9 b118Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Description
The fix for JDK-8151339 removed the #runtime fragment from URLs referencing resources in regular (i.e. not multi-release) jars.  The fragment is still visible for URLs referencing resources in multi-release jars, as intended by the current design.

Modifying the URL, adding a fragment in the current implementation, or say modifying the scheme, or the path in some way is advantageous in one respect, it elegantly provides the information from the disparate class loading parts to the jar URL connection parts.

However, clients parsing URLs often take short-cuts operating on the characters of the encoded URL. Perturbing the existing resource URL contents in this respect will trigger bugs in (arguably buggy) code when those URLs are for resources to multi-release jars.

Alternative solutions need to be investigated:

- reify the URL to a resource in a multi-release jar;

- choose an alternative encoding in the URL that is less intrusive, such as a new scheme (note that Project Jigsaw introduces a new scheme for resources within the image, which will contain platform modules and possibly user-defined modules, so resource URL modification is not unprecedented. Also note that class loaders of certain application servers also support alternative URL schemes).