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

sun.net.www.protocol.jar.JarFileFactory.close(JarFile) should be thread-safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • None
    • core-libs
    • b84
    • Not verified

        JarFileFactory has two Maps that it uses to implement caching of jar files. Access to these maps should always be done while holding the instance lock, as multiple threads can be simultaneously updating the maps.

        The close method was added some time after the original implementation, and it looks like the locking was forgotten. Also, the locking strategy assumes that JarFileFactory is a singleton. It could be reworked to make it more robust.

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

                Created:
                Updated:
                Resolved: