mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 08:36:01 +00:00
URLClassLoader is Closeable in Java 7, no need for a workaround.
This commit is contained in:
1 parent
0552f5ad75
commit
ec0b59d230
1 file changed
+2
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user