git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276623 13f79535-47bb-0310-9956-ffa450edef68master
@@ -28,7 +28,6 @@ import java.util.Iterator; | |||||
import java.util.Vector; | import java.util.Vector; | ||||
import java.util.Set; | import java.util.Set; | ||||
import java.util.HashSet; | import java.util.HashSet; | ||||
import org.apache.tools.ant.AntClassLoader; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.BuildListener; | import org.apache.tools.ant.BuildListener; | ||||
import org.apache.tools.ant.DefaultLogger; | import org.apache.tools.ant.DefaultLogger; | ||||
@@ -174,6 +174,7 @@ public class ExecuteJava implements Runnable, TimeoutObserver { | |||||
if (loader != null) { | if (loader != null) { | ||||
loader.resetThreadContextLoader(); | loader.resetThreadContextLoader(); | ||||
loader.cleanup(); | loader.cleanup(); | ||||
loader = null; | |||||
} | } | ||||
if (sysProperties != null) { | if (sysProperties != null) { | ||||
sysProperties.restoreSystem(); | sysProperties.restoreSystem(); | ||||
@@ -270,6 +270,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
} finally { | } finally { | ||||
if (loader != null) { | if (loader != null) { | ||||
loader.resetThreadContextLoader(); | loader.resetThreadContextLoader(); | ||||
loader.cleanup(); | |||||
loader = null; | loader = null; | ||||
} | } | ||||
liaison = null; | liaison = null; | ||||
@@ -402,13 +402,17 @@ public class ANTLR extends Task { | |||||
* @since Ant 1.6 | * @since Ant 1.6 | ||||
*/ | */ | ||||
protected boolean is272() { | protected boolean is272() { | ||||
AntClassLoader l = null; | |||||
try { | try { | ||||
AntClassLoader l = new AntClassLoader(getProject(), | |||||
commandline.getClasspath()); | |||||
l = getProject().createClassLoader(commandline.getClasspath()); | |||||
l.loadClass("antlr.Version"); | l.loadClass("antlr.Version"); | ||||
return true; | return true; | ||||
} catch (ClassNotFoundException e) { | } catch (ClassNotFoundException e) { | ||||
return false; | return false; | ||||
} // end of try-catch | |||||
} finally { | |||||
if (l != null) { | |||||
l.cleanup(); | |||||
} | |||||
} | |||||
} | } | ||||
} | } |