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

URL should not use service loader to lookup the jar protocol handler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • b53

    Backports

      Description

        JDK-8064924 changed the way protocol handlers are being discovered. Protocol handlers are now being looked up using service loader. It is not appropriate to use service loader to look for 'jar' handlers, as services are typically deployed as jar files. The following changes were accidentially omitted from the original changes for JDK-8064924.

        diff --git a/src/java.base/share/classes/java/net/URL.java b/src/java.base/share/classes/java/net/URL.java
        --- a/src/java.base/share/classes/java/net/URL.java
        +++ b/src/java.base/share/classes/java/net/URL.java
        @@ -1248,7 +1248,7 @@
                         checkedWithFactory = true;
                     }
         
        - if (handler == null) {
        + if (handler == null && !protocol.equalsIgnoreCase("jar")) {
                         handler = lookupViaProviders(protocol);
                     }
                 }

        Attachments

          Issue Links

            Activity

              People

                chegar Chris Hegarty
                chegar Chris Hegarty
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: