diff --git a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java index e30b55a28..7b37970a6 100644 --- a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java +++ b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java @@ -173,17 +173,13 @@ public class ProjectHandler extends ModelElementHandler { } catch (ModelException e) { throw new SAXParseException(e.getMessage(), getLocator(), e); } - } else if (localName != null) { + } else { // everything else is a task BuildElementHandler buildElementHandler = new BuildElementHandler(); buildElementHandler.start(getParseContext(), getXMLReader(), this, getLocator(), attributes, getElementSource(), qualifiedName); project.addTask(buildElementHandler.getBuildElement()); - } else { - // ignore namespaced elements - throw new SAXParseException("namespace support is not " - + "currently recognized (" + qualifiedName + ")", getLocator()); } } diff --git a/proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java b/proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java index b21299164..bfe8dd57d 100755 --- a/proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java +++ b/proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java @@ -116,11 +116,12 @@ public class InitConfig { /** * Constructor for the Initialization configuration * + * @param libraryClass - a class loaded from the Ant library area. * @exception InitException if the configuration cannot be initialized */ - public InitConfig() throws InitException { + public InitConfig(Class libraryClass) throws InitException { try { - URL antLibURL = getAntLibURL(); + URL antLibURL = getAntLibURL(libraryClass); setLibraryURL(antLibURL); URL antHome = new URL(antLibURL, ".."); @@ -331,12 +332,13 @@ public class InitConfig { /** * Get a URL to the Ant Library directory. * + * @param libraryClass - a class loaded from the Ant library area. * @return the URL for the Ant library directory * @throws MalformedURLException if there is a problem constructing the * library URL */ - private URL getAntLibURL() throws MalformedURLException { - URL initClassURL = ClassLocator.getClassLocationURL(getClass()); + private URL getAntLibURL(Class libraryClass) throws MalformedURLException { + URL initClassURL = ClassLocator.getClassLocationURL(libraryClass); String initURLString = initClassURL.toString(); int index = initURLString.lastIndexOf("/"); diff --git a/proposal/mutant/src/java/start/org/apache/ant/start/Main.java b/proposal/mutant/src/java/start/org/apache/ant/start/Main.java index 2ae986c1f..7b5eef3f6 100755 --- a/proposal/mutant/src/java/start/org/apache/ant/start/Main.java +++ b/proposal/mutant/src/java/start/org/apache/ant/start/Main.java @@ -135,7 +135,7 @@ public class Main { public void start(String frontend, String defaultClass, String[] args) throws InitException { try { - InitConfig config = new InitConfig(); + InitConfig config = new InitConfig(getClass()); URL frontendJar = new URL(config.getLibraryURL(), "frontend/" + frontend + ".jar"); @@ -149,8 +149,8 @@ public class Main { if (frontendJar.getProtocol().equals("file")) { File jarFile = new File(frontendJar.getFile()); if (!jarFile.exists()) { - throw new InitException("Could not jar for frontend \"" - + frontend + "\""); + throw new InitException("Could not find jar for frontend \"" + + frontend + "\" - expected at " + frontendJar); } } String mainClass = getMainClass(frontendJar);