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

URLClassLoader should have an explicit disposal mechanism

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      This is a special case of of 4950148 which is arguably worth handling separately.

      The problems of closing a ClassLoader are understood and described in 4950148.

      However, until that bug is fixed, it would be useful to have URLClassLoader implement
      Closeable and close() with a more limited specification that it should close any open JarFiles which it is using. If and when ClassLoader itself implements Closeable, then URLClassLoader.close() can call super.close() to have all the right additional things happen.

      See 6558476 for a problem reported against javac, which boils down to the same problem. Currently, the proposed fix for javac is to try and use reflection to access the private fields containing the jar files in order to close them. It would be better if URLClassLoader provided that functionality directly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                jjg Jonathan Gibbons
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: