ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r811435 - in /ant/core/trunk/src/main/org/apache/tools/ant: taskdefs/ taskdefs/compilers/ taskdefs/condition/ taskdefs/optional/ taskdefs/optional/ejb/ taskdefs/optional/javacc/ taskdefs/optional/javah/ taskdefs/optional/jsp/ taskdefs/optio...
Date Fri, 04 Sep 2009 15:02:40 GMT
Author: bodewig
Date: Fri Sep  4 15:02:39 2009
New Revision: 811435

URL: http://svn.apache.org/viewvc?rev=811435&view=rev
Log:
plug some more classloader leaks and mark those places where a leak remains and I don't see
an obvious way to fix it

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java Fri Sep  4 15:02:39
2009
@@ -30,6 +30,7 @@
 import java.util.Properties;
 import java.util.Vector;
 
+import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.PropertyHelper;
@@ -558,10 +559,11 @@
         Properties props = new Properties();
         log("Resource Loading " + name, Project.MSG_VERBOSE);
         InputStream is = null;
+        ClassLoader cL = null;
+        boolean cleanup = false;
         try {
-            ClassLoader cL = null;
-
             if (classpath != null) {
+                cleanup = true;
                 cL = getProject().createClassLoader(classpath);
             } else {
                 cL = this.getClass().getClassLoader();
@@ -589,6 +591,9 @@
                     // ignore
                 }
             }
+            if (cleanup && cL != null) {
+                ((AntClassLoader) cL).cleanup();
+            }
         }
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java Fri Sep  4 15:02:39 2009
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.rmi.Remote;
 import java.util.Vector;
+import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.Project;
@@ -104,7 +105,7 @@
 
     private Vector compileList = new Vector();
 
-    private ClassLoader loader = null;
+    private AntClassLoader loader = null;
 
     private FacadeTaskHelper facade;
     /** unable to verify message */
@@ -581,6 +582,7 @@
      * if there's a problem with baseDir or RMIC
      */
     public void execute() throws BuildException {
+        try {
         compileList.clear();
 
         File outputDir = getOutputDir();
@@ -659,6 +661,21 @@
                 }
             }
         }
+        } finally {
+            cleanup();
+        }
+    }
+
+    /**
+     * Cleans up resources.
+     *
+     * @since Ant 1.8.0
+     */
+    protected void cleanup() {
+        if (loader != null) {
+            loader.cleanup();
+            loader = null;
+        }
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.java Fri Sep  4 15:02:39
2009
@@ -126,15 +126,16 @@
     public void execute() throws BuildException {
         validate();
         if (classpath != null) {
+            classpath = classpath.concatSystemClasspath("ignore");
             getProject().log("using user supplied classpath: " + classpath,
                     Project.MSG_DEBUG);
-            classpath = classpath.concatSystemClasspath("ignore");
         } else {
             classpath = new Path(getProject());
             classpath = classpath.concatSystemClasspath("only");
             getProject().log("using system classpath: " + classpath, Project.MSG_DEBUG);
         }
-        AntClassLoader loader;
+        AntClassLoader loader = null;
+        try {
         loader = AntClassLoader.newAntClassLoader(getProject().getCoreLoader(),
                     getProject(),
                     classpath, false);
@@ -160,6 +161,11 @@
             loc = url.toExternalForm();
             getProject().setNewProperty(property, loc);
         }
+        } finally {
+            if (loader != null) {
+                loader.cleanup();
+            }
+        }
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
Fri Sep  4 15:02:39 2009
@@ -152,6 +152,7 @@
                 return new Sj();
             }
             return resolveClassName(compilerType,
+                                    // Memory-Leak in line below
                                 task.getProject().createClassLoader(classpath));
         }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasMethod.java Fri Sep
 4 15:02:39 2009
@@ -110,7 +110,6 @@
                 loader = getProject().createClassLoader(classpath);
                 loader.setParentFirst(false);
                 loader.addJavaLibraries();
-                if (loader != null) {
                     try {
                         return loader.findClass(classname);
                     } catch (SecurityException se) {
@@ -118,11 +117,9 @@
                         // actually the case we're looking for in JDK 1.3+,
                         // so catch the exception and return
                         return null;
-                    }
-                } else {
-                    return null;
                 }
             } else if (loader != null) {
+                // How do we ever get here?
                 return loader.loadClass(classname);
             } else {
                 ClassLoader l = this.getClass().getClassLoader();
@@ -148,6 +145,8 @@
         if (classname == null) {
             throw new BuildException("No classname defined");
         }
+        ClassLoader preLoadClass = loader;
+        try {
         Class clazz = loadClass(classname);
         if (method != null) {
             return isMethodFound(clazz);
@@ -156,6 +155,12 @@
             return isFieldFound(clazz);
         }
         throw new BuildException("Neither method nor field defined");
+        } finally {
+            if (preLoadClass != loader && loader != null) {
+                loader.cleanup();
+                loader = null;
+            }
+        }
     }
 
     private boolean isFieldFound(Class clazz) {

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java Fri
Sep  4 15:02:39 2009
@@ -103,6 +103,8 @@
     public static final String MESSAGE_FILES_VALIDATED
         = " file(s) have been successfully validated.";
 
+    private AntClassLoader readerLoader = null;
+
     /**
      * Specify how parser error are to be handled.
      * Optional, default is <code>true</code>.
@@ -285,7 +287,7 @@
      * @throws BuildException if <code>failonerror</code> is true and an error
happens
      */
     public void execute() throws BuildException {
-
+        try {
         int fileProcessed = 0;
         if (file == null && (filesets.size() == 0)) {
             throw new BuildException(
@@ -321,6 +323,9 @@
             }
         }
         onSuccessfulValidation(fileProcessed);
+        } finally {
+            cleanup();
+        }
     }
 
     /**
@@ -389,9 +394,9 @@
             try {
                 // load the parser class
                 if (classpath != null) {
-                    AntClassLoader loader =
-                        getProject().createClassLoader(classpath);
-                    readerClass = Class.forName(readerClassName, true, loader);
+                    readerLoader = getProject().createClassLoader(classpath);
+                    readerClass = Class.forName(readerClassName, true,
+                                                readerLoader);
                 } else {
                     readerClass = Class.forName(readerClassName);
                 }
@@ -432,6 +437,18 @@
     }
 
     /**
+     * Cleans up resources.
+     *
+     * @since Ant 1.8.0
+     */
+    protected void cleanup() {
+        if (readerLoader != null) {
+            readerLoader.cleanup();
+            readerLoader = null;
+        }
+    }
+
+    /**
      *
      * @return
      */

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
Fri Sep  4 15:02:39 2009
@@ -929,6 +929,7 @@
         if (combinedClasspath == null) {
             classpathLoader = getClass().getClassLoader();
         } else {
+            // Memory leak in line below
             classpathLoader
                 = getTask().getProject().createClassLoader(combinedClasspath);
         }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
Fri Sep  4 15:02:39 2009
@@ -679,7 +679,10 @@
         log("Looking for GenIC class in classpath: "
             + classpath.toString(), Project.MSG_VERBOSE);
 
-        AntClassLoader cl = classpath.getProject().createClassLoader(classpath);
+        AntClassLoader cl = null;
+
+        try {
+            cl = classpath.getProject().createClassLoader(classpath);
 
         try {
             cl.loadClass(JonasDeploymentTool.GENIC_CLASS);
@@ -716,6 +719,11 @@
                 + "' not found in classpath.",
             Project.MSG_VERBOSE);
         }
+        } finally {
+            if (cl != null) {
+                cl.cleanup();
+            }
+        }
         return null;
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
Fri Sep  4 15:02:39 2009
@@ -27,6 +27,7 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
+import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.Java;
@@ -589,11 +590,9 @@
                     classpath = getCombinedClasspath();
                 }
 
+                javaTask.setFork(true);
                 if (classpath != null) {
                     javaTask.setClasspath(classpath);
-                    javaTask.setFork(true);
-                } else {
-                    javaTask.setFork(true);
                 }
 
                 log("Calling websphere.ejbdeploy for " + sourceJar.toString(),
@@ -684,6 +683,7 @@
         JarFile wasJar = null;
         File newwasJarFile = null;
         JarOutputStream newJarStream = null;
+        ClassLoader genericLoader = null;
 
         try {
             log("Checking if websphere Jar needs to be rebuilt for jar "
@@ -713,7 +713,7 @@
                 }
 
                 //Cycle Through generic and make sure its in websphere
-                ClassLoader genericLoader = getClassLoaderFromJar(genericJarFile);
+                genericLoader = getClassLoaderFromJar(genericJarFile);
 
                 for (Enumeration e = genericEntries.keys(); e.hasMoreElements();) {
                     String filepath = (String) e.nextElement();
@@ -861,6 +861,11 @@
                     rebuild = true;
                 }
             }
+            if (genericLoader != null
+                && genericLoader instanceof AntClassLoader) {
+                AntClassLoader loader = (AntClassLoader) genericLoader;
+                loader.cleanup();
+            }
         }
 
         return rebuild;
@@ -889,4 +894,3 @@
         return getTask().getProject().createClassLoader(lookupPath);
     }
 }
-

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java Fri
Sep  4 15:02:39 2009
@@ -411,7 +411,9 @@
         String packagePrefix = null;
         String mainClass = null;
 
-        AntClassLoader l =
+        AntClassLoader l = null;
+        try {
+            l =
             AntClassLoader.newAntClassLoader(null, null,
                                              path
                                              .concatSystemClasspath("ignore"),
@@ -483,6 +485,11 @@
             throw new BuildException("unknown task type " + type);
         }
         return packagePrefix + mainClass;
+        } finally {
+            if (l != null) {
+                l.cleanup();
+            }
+        }
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
Fri Sep  4 15:02:39 2009
@@ -86,6 +86,7 @@
             return new SunJavah();
         } else if (choice != null) {
             return resolveClassName(choice,
+                                    // Memory leak in line below
                                     log.getProject()
                                     .createClassLoader(classpath));
         }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java Fri Sep 
4 15:02:39 2009
@@ -22,6 +22,7 @@
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.Vector;
+import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.Project;
@@ -436,10 +437,12 @@
 
         File dest = getActualDestDir();
 
+        AntClassLoader al = null;
+        try {
         //bind to a compiler
         JspCompilerAdapter compiler =
             JspCompilerAdapterFactory.getCompiler(compilerName, this,
-                getProject().createClassLoader(compilerClasspath));
+                al = getProject().createClassLoader(compilerClasspath));
 
         //if we are a webapp, hand off to the compiler, which had better handle it
         if (webApp != null) {
@@ -503,6 +506,11 @@
                 log("all files are up to date", Project.MSG_VERBOSE);
             }
         }
+        } finally {
+            if (al != null) {
+                al.cleanup();
+            }
+        }
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
Fri Sep  4 15:02:39 2009
@@ -54,6 +54,7 @@
     public static JspCompilerAdapter getCompiler(String compilerType, Task task)
         throws BuildException {
         return getCompiler(compilerType, task,
+                           // Memory-Leak in line below
                            task.getProject().createClassLoader(null));
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Fri
Sep  4 15:02:39 2009
@@ -1108,7 +1108,9 @@
         if (!cmd.haveClasspath()) {
             return;
         }
-        AntClassLoader loader = AntClassLoader.newAntClassLoader(null,
+        AntClassLoader loader = null;
+        try {
+            loader = AntClassLoader.newAntClassLoader(null,
             getProject(), cmd.createClasspath(getProject()),
             true);
         String projectResourceName = LoaderUtils.classNameToResource(
@@ -1131,6 +1133,11 @@
         } catch (Exception ex) {
             // Ignore exception
         }
+        } finally {
+            if (loader != null) {
+                loader.cleanup();
+            }
+        }
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
Fri Sep  4 15:02:39 2009
@@ -86,6 +86,7 @@
             return new SunNative2Ascii();
         } else if (choice != null) {
             return resolveClassName(choice,
+                                    // Memory leak in line below
                                     log.getProject()
                                     .createClassLoader(classpath));
         }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/RmicAdapterFactory.java Fri
Sep  4 15:02:39 2009
@@ -118,6 +118,7 @@
         }
         //no match? ask for the non-lower-cased type
         return resolveClassName(rmicType,
+                                // Memory leak in line below
                                 task.getProject().createClassLoader(classpath));
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/Mapper.java Fri Sep  4 15:02:39 2009
@@ -261,6 +261,7 @@
 
         ClassLoader loader = (classpath == null)
             ? getClass().getClassLoader()
+            // Memory leak in line below
             : getProject().createClassLoader(classpath);
 
         return Class.forName(cName, true, loader);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/XMLCatalog.java Fri Sep  4 15:02:39
2009
@@ -500,7 +500,7 @@
         if (catalogResolver == null) {
 
             AntClassLoader loader = null;
-
+            // Memory-Leak in line below
             loader = getProject().createClassLoader(Path.systemClasspath);
 
             try {

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java Fri Sep
 4 15:02:39 2009
@@ -65,6 +65,7 @@
                 if (classpath == null) {
                     c = Class.forName(classname);
                 } else {
+                    // Memory-Leak in line below
                     AntClassLoader al
                             = getProject().createClassLoader(classpath);
                     c = Class.forName(classname, true, al);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java?rev=811435&r1=811434&r2=811435&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
Fri Sep  4 15:02:39 2009
@@ -646,6 +646,7 @@
                 // the usual classloader
                 ? getClass().getClassLoader()
                 // additional use the provided classpath
+                // Memory leak in line below
                 : getProject().createClassLoader(classpath);
         }
         return myClassLoader;



Mime
View raw message