ClassReader leaks file descriptors
ClassReader class in the org.objectweb.asm package doesn't close input streams.
/**
* Constructs a new {@link ClassReader} object.
*
* @param name the binary qualified name of the class to be read.
* @throws IOException if an exception occurs during reading.
*/
public ClassReader(final String name) throws IOException {
this(ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
+ ".class"));
}
If you use this constructor, any InputStream returned by
ClassLoader.getSystemResourceAsStream() will never be closed properly.
Eventually we will run out of file descriptors on the system.
Regards,
Yoshiki Shibata