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

Audit new (Zip|Jar)File without corresponding close()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 6
    • core-libs

      Most of the time, a creation of a new ZipFile object should
      be paired with a close(), so that operating system resources
      are reclaimed in a timely manner.

      Here are some suspicious places within the JDK that should be
      investigated:

      ./com/sun/tools/javadoc/PackageDocImpl.java:94: ZipFile f = new ZipFile(zipDocPath);
      ./sun/misc/ExtensionDependency.java:277: JarFile jarFile = new JarFile(file);

      The following has a close(), but it should be protected by try{}finally{...}
      ./sun/misc/JarIndex.java:178: ZipFile zrf = new ZipFile(currentJar.replace
      ./sun/security/tools/JarSigner.java:416: JarFile jf = new JarFile(jarName, true);
      ./sun/security/tools/JarSigner.java:801: zipFile = new ZipFile(jarName);
      ./sun/tools/jar/Main.java:793: JarFile rf = new JarFile(jar.replace('/', File.separatorChar));
      ./sun/tools/javap/JavapEnvironment.java:257: JarFile jfile = new JarFile(filelist[i]);
      ./sun/tools/javap/JavapEnvironment.java:311: JarFile jfile = new JarFile(fileobj);

            sherman Xueming Shen
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: