Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8151542

URL resources for multi-release jar files have a #runtime fragment appended to them

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      b118

      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).

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sdrach Steve Drach (Inactive)
                Reporter:
                sdrach Steve Drach (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: