Browse Source

Finally make <taskdef>s with nested classpath elements work wherever

they are.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268283 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
963798591e
1 changed files with 10 additions and 7 deletions
  1. +10
    -7
      src/main/org/apache/tools/ant/ProjectHelper.java

+ 10
- 7
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -170,8 +170,15 @@ public class ProjectHelper {
} }
} }


/**
* Called when this element and all elements nested into it have been
* handeled.
*/
protected void finished() {}

public void endElement(String name) throws SAXException { public void endElement(String name) throws SAXException {


finished();
// Let parent resume handling SAX events // Let parent resume handling SAX events
parser.setDocumentHandler(parentHandler); parser.setDocumentHandler(parentHandler);
} }
@@ -291,15 +298,11 @@ public class ProjectHelper {
} }


private void handleTaskdef(String name, AttributeList attrs) throws SAXParseException { private void handleTaskdef(String name, AttributeList attrs) throws SAXParseException {
TaskHandler childHandler = new TaskHandler(this, null);
childHandler.init(name, attrs);
childHandler.finished();
(new TaskHandler(this, null)).init(name, attrs);
} }


private void handleProperty(String name, AttributeList attrs) throws SAXParseException { private void handleProperty(String name, AttributeList attrs) throws SAXParseException {
TaskHandler childHandler = new TaskHandler(this, null);
childHandler.init(name, attrs);
childHandler.finished();
(new TaskHandler(this, null)).init(name, attrs);
} }


private void handleTarget(String tag, AttributeList attrs) throws SAXParseException { private void handleTarget(String tag, AttributeList attrs) throws SAXParseException {
@@ -424,7 +427,7 @@ public class ProjectHelper {
} }
} }


public void finished() {
protected void finished() {
if (task != null && target == null) { if (task != null && target == null) {
task.execute(); task.execute();
} }


Loading…
Cancel
Save