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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b53

        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);
                     }
                 }

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

                Created:
                Updated:
                Resolved: