ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r796614 - in /ant/core/trunk/src/main/org/apache/tools/ant: AntClassLoader.java Project.java taskdefs/Classloader.java taskdefs/WhichResource.java taskdefs/optional/javacc/JavaCC.java taskdefs/optional/junit/JUnitTask.java
Date Wed, 22 Jul 2009 05:03:36 GMT
Author: bodewig
Date: Wed Jul 22 05:03:35 2009
New Revision: 796614

URL: http://svn.apache.org/viewvc?rev=796614&view=rev
Log:
make all classes use the same AntClassLoader constructor

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java
    ant/core/trunk/src/main/org/apache/tools/ant/Project.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Classloader.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WhichResource.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/junit/JUnitTask.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java?rev=796614&r1=796613&r2=796614&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java Wed Jul 22 05:03:35 2009
@@ -1456,4 +1456,14 @@
         return "AntClassLoader[" + getClasspath() + "]";
     }
 
+    /**
+     * Factory method
+     */
+    public static AntClassLoader newAntClassLoader(ClassLoader parent,
+                                                   Project project,
+                                                   Path path,
+                                                   boolean parentFirst) {
+        return new AntClassLoader(parent, project, path, parentFirst);
+    }
+
 }
\ No newline at end of file

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Project.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?rev=796614&r1=796613&r2=796614&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Project.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Project.java Wed Jul 22 05:03:35 2009
@@ -335,8 +335,8 @@
      * @return an appropriate classloader.
      */
     public AntClassLoader createClassLoader(Path path) {
-        return new AntClassLoader(
-            getClass().getClassLoader(), this, path);
+        return AntClassLoader
+            .newAntClassLoader(getClass().getClassLoader(), this, path, true);
     }
 
     /**
@@ -350,7 +350,7 @@
      */
     public AntClassLoader createClassLoader(
         ClassLoader parent, Path path) {
-        return new AntClassLoader(parent, this, path);
+        return AntClassLoader.newAntClassLoader(parent, this, path, true);
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Classloader.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Classloader.java?rev=796614&r1=796613&r2=796614&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Classloader.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Classloader.java Wed Jul 22 05:03:35
2009
@@ -210,7 +210,7 @@
                     + parent + " " + parentFirst, Project.MSG_DEBUG);
 
                 // The param is "parentFirst"
-                acl = new AntClassLoader((ClassLoader) parent,
+                acl = AntClassLoader.newAntClassLoader((ClassLoader) parent,
                          getProject(), classpath, parentFirst);
 
                 getProject().addReference(loaderName, acl);

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=796614&r1=796613&r2=796614&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 Wed Jul 22 05:03:35
2009
@@ -135,7 +135,7 @@
             getProject().log("using system classpath: " + classpath, Project.MSG_DEBUG);
         }
         AntClassLoader loader;
-        loader = new AntClassLoader(getProject().getCoreLoader(),
+        loader = AntClassLoader.newAntClassLoader(getProject().getCoreLoader(),
                     getProject(),
                     classpath, false);
         String loc = null;

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=796614&r1=796613&r2=796614&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 Wed
Jul 22 05:03:35 2009
@@ -411,8 +411,11 @@
         String packagePrefix = null;
         String mainClass = null;
 
-        AntClassLoader l = new AntClassLoader();
-        l.setClassPath(path.concatSystemClasspath("ignore"));
+        AntClassLoader l =
+            AntClassLoader.newAntClassLoader(null, null,
+                                             path
+                                             .concatSystemClasspath("ignore"),
+                                             true);
         String javaccClass = COM_PACKAGE + COM_JAVACC_CLASS;
         InputStream is = l.getResourceAsStream(javaccClass.replace('.', '/')
                                                + ".class");

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=796614&r1=796613&r2=796614&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 Wed
Jul 22 05:03:35 2009
@@ -1131,8 +1131,9 @@
         if (!cmd.haveClasspath()) {
             return;
         }
-        AntClassLoader loader = new AntClassLoader(
-            getProject(), cmd.createClasspath(getProject()));
+        AntClassLoader loader = AntClassLoader.newAntClassLoader(null,
+            getProject(), cmd.createClasspath(getProject()),
+            true);
         String projectResourceName = LoaderUtils.classNameToResource(
             Project.class.getName());
         URL previous = null;



Mime
View raw message