JDK-5074023 : Audit new (Zip|Jar)File without corresponding close()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2004-07-14
  • Updated: 2015-07-30
  • Resolved: 2015-07-30
Related Reports
Relates :  
Description
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);

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
16-07-2004

PUBLIC COMMENTS -
16-07-2004

EVALUATION Looks like it, but the hard part is testing, of course. ###@###.### 2004-07-14
14-07-2004