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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • 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);
                     }
                 }

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

                Created:
                Updated:
                Resolved: