diff --git a/src/main/org/apache/tools/ant/taskdefs/Definer.java b/src/main/org/apache/tools/ant/taskdefs/Definer.java index 49a60fd00..ac5945eea 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Definer.java +++ b/src/main/org/apache/tools/ant/taskdefs/Definer.java @@ -97,25 +97,20 @@ public abstract class Definer extends Task { } try { ClassLoader loader = null; + AntClassLoader al = null; if (classpath != null) { - AntClassLoader al = new AntClassLoader(project, classpath, - false); - // need to load Task via system classloader or the new - // task we want to define will never be a Task but always - // be wrapped into a TaskAdapter. - al.addSystemPackageRoot("org.apache.tools.ant"); - loader = al; + al = new AntClassLoader(project, classpath, false); } else { - loader = this.getClass().getClassLoader(); + al = new AntClassLoader(project, Path.systemClasspath, false); } + // need to load Task via system classloader or the new + // task we want to define will never be a Task but always + // be wrapped into a TaskAdapter. + al.addSystemPackageRoot("org.apache.tools.ant"); + loader = al; - Class c = null; - if (loader != null) { - c = loader.loadClass(value); - AntClassLoader.initializeClass(c); - } else { - c = Class.forName(value); - } + Class c = loader.loadClass(value); + AntClassLoader.initializeClass(c); addDefinition(name, c); } catch (ClassNotFoundException cnfe) { String msg = getTaskName()+" class " + value + diff --git a/src/main/org/apache/tools/ant/types/Path.java b/src/main/org/apache/tools/ant/types/Path.java index d8f3bbc1d..d7405fa7a 100644 --- a/src/main/org/apache/tools/ant/types/Path.java +++ b/src/main/org/apache/tools/ant/types/Path.java @@ -484,9 +484,14 @@ public class Path extends DataType implements Cloneable { Path result = new Path(project); - String order = project.getProperty("build.sysclasspath"); - if (order == null) order=defValue; - + String order = defValue; + if (project != null) { + String o = project.getProperty("build.sysclasspath"); + if (o != null) { + order = o; + } + } + if (order.equals("only")) { // only: the developer knows what (s)he is doing result.addExisting(Path.systemClasspath); diff --git a/src/main/org/apache/tools/zip/ZipExtraField.java b/src/main/org/apache/tools/zip/ZipExtraField.java index c4022475f..034d55f8c 100644 --- a/src/main/org/apache/tools/zip/ZipExtraField.java +++ b/src/main/org/apache/tools/zip/ZipExtraField.java @@ -59,11 +59,11 @@ import java.util.zip.ZipException; /** * General format of extra field data. * - *
Extra fields usually apper twice per file, once in the local + *
Extra fields usually appear twice per file, once in the local * file data and once in the central directory. Usually they are the * same, but they don't have to be. {@link * java.util.zip.ZipOutputStream java.util.zip.ZipOutputStream} will - * only use write the local file data at both places.
+ * only use the local file data in both places. * * @author Stefan Bodewig * @version $Revision$