From e2e194c8543e4e70514a4f19ca5d256f9c307439 Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Wed, 24 Apr 2002 06:16:46 +0000 Subject: [PATCH] Make sure generic jar is not help open by loader git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272563 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/AntClassLoader.java | 2 +- .../ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/AntClassLoader.java b/src/main/org/apache/tools/ant/AntClassLoader.java index 5fc464283..0ccaf32d9 100644 --- a/src/main/org/apache/tools/ant/AntClassLoader.java +++ b/src/main/org/apache/tools/ant/AntClassLoader.java @@ -1107,7 +1107,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener { pathComponents = null; project = null; for (Enumeration e = zipFiles.elements(); e.hasMoreElements();) { - ZipFile zipFile = (ZipFile) e.nextElement(); + ZipFile zipFile = (ZipFile)e.nextElement(); try { zipFile.close(); } catch (IOException ioe) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java index a0336b24b..783aa42a5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java @@ -608,7 +608,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { } //Cycle Through generic and make sure its in weblogic - ClassLoader genericLoader = getClassLoaderFromJar(genericJarFile); + ClassLoader genericLoader + = getClassLoaderFromJar(genericJarFile); for (Enumeration e = genericEntries.keys(); e.hasMoreElements();) { String filepath = (String) e.nextElement(); @@ -702,6 +703,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { log("Weblogic Jar rebuild needed due to changed " + "interface or XML", Project.MSG_VERBOSE); } + + if (genericLoader instanceof AntClassLoader) { + AntClassLoader loader = (AntClassLoader)genericLoader; + loader.cleanup(); + } } else { rebuild = true; }