提交 ec0b59d2 编写于 作者: J Jesse Glick

URLClassLoader is Closeable in Java 7, no need for a workaround.

上级 0552f5ad
......@@ -201,7 +201,7 @@ public class ClassicPluginStrategy implements PluginStrategy {
return classLoader;
}
}
if(useAntClassLoader) {
if(useAntClassLoader && !Closeable.class.isAssignableFrom(URLClassLoader.class)) {
// using AntClassLoader with Closeable so that we can predictably release jar files opened by URLClassLoader
AntClassLoader2 classLoader = new AntClassLoader2(parent);
classLoader.addPathFiles(paths);
......@@ -564,6 +564,7 @@ public class ClassicPluginStrategy implements PluginStrategy {
/**
* {@link AntClassLoader} with a few methods exposed and {@link Closeable} support.
* Deprecated as of Java 7, retained only for Java 5/6.
*/
private static final class AntClassLoader2 extends AntClassLoader implements Closeable {
private final Vector pathComponents;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册