Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3634

Avoid risk of deadlock and speed up execution in JDKBugHacks.doHacks()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3.6, 2.4.2, 2.5
    • Core
    • None

    Description

      In order for disabling url caching, JDKBugHacks runs:

      URL url = new URL("jar:file://dummy.jar!/");
      URLConnection uConn = url.openConnection();
      uConn.setDefaultUseCaches(false);

      When having the java.protocol.handler.pkgs system property set, that can lead to deadlocks between the system classloader and the file protocol Handler in particular situations (for instance if the file protocol URLStreamHandler is a signleton).
      Besides that, the code above is really there for the sake of setting defaultUseCaches to false only, so actually opening a connection can be avoided, to speed up the execution.

      Attachments

        Activity

          People

            asoldano Alessio Soldano
            asoldano Alessio Soldano
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: