ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant ProjectHelper.java
Date Fri, 02 Nov 2001 10:25:20 GMT
bodewig     01/11/02 02:25:20

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
  Log:
  Make sure tasks inside TaskContainers get their attribute setters
  called, even if the parent TaskContainer doesn't take care of it
  itself.
  
  Submitted by:	Ovidiu Predescu <ovidiu@cup.hp.com>
  
  Revision  Changes    Path
  1.65      +10 -6     jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- ProjectHelper.java	2001/10/31 11:04:59	1.64
  +++ ProjectHelper.java	2001/11/02 10:25:20	1.65
  @@ -362,11 +362,11 @@
           }
   
           private void handleTaskdef(String name, AttributeList attrs) throws SAXParseException
{
  -            (new TaskHandler(this, null, null)).init(name, attrs);
  +            (new TaskHandler(this, null, null, null)).init(name, attrs);
           }
   
           private void handleProperty(String name, AttributeList attrs) throws SAXParseException
{
  -            (new TaskHandler(this, null, null)).init(name, attrs);
  +            (new TaskHandler(this, null, null, null)).init(name, attrs);
           }
   
           private void handleTarget(String tag, AttributeList attrs) throws SAXParseException
{
  @@ -443,7 +443,7 @@
               if (project.getDataTypeDefinitions().get(name) != null) {
                   new DataTypeHandler(this, target).init(name, attrs);
               } else {
  -                new TaskHandler(this, target, target).init(name, attrs);
  +                new TaskHandler(this, target, null, target).init(name, attrs);
               }
           }
       }
  @@ -455,11 +455,13 @@
           private Target target;
           private TaskContainer container;
           private Task task;
  +        private RuntimeConfigurable parentWrapper;
           private RuntimeConfigurable wrapper = null;
   
  -        public TaskHandler(DocumentHandler parentHandler, TaskContainer container, Target
target) {
  +        public TaskHandler(DocumentHandler parentHandler, TaskContainer container, RuntimeConfigurable
parentWrapper, Target target) {
               super(parentHandler);
               this.container = container;
  +            this.parentWrapper = parentWrapper;
               this.target = target;
           }
   
  @@ -488,6 +490,8 @@
                   task.init();
                   wrapper = task.getRuntimeConfigurableWrapper();
                   wrapper.setAttributes(attrs);
  +                if (parentWrapper != null)
  +                  parentWrapper.addChild(wrapper);
               } else {
                   task.init();
                   configure(task, attrs, project);
  @@ -515,7 +519,7 @@
           public void startElement(String name, AttributeList attrs) throws SAXParseException
{
               if (task instanceof TaskContainer) {
                   // task can contain other tasks - no other nested elements possible
  -                new TaskHandler(this, (TaskContainer)task, target).init(name, attrs);
  +                new TaskHandler(this, (TaskContainer)task, wrapper, target).init(name,
attrs);
               }
               else {
                   new NestedElementHandler(this, task, wrapper, target).init(name, attrs);
  @@ -593,7 +597,7 @@
               if (child instanceof TaskContainer) {
                   // taskcontainer nested element can contain other tasks - no other 
                   // nested elements possible
  -                new TaskHandler(this, (TaskContainer)child, target).init(name, attrs);
  +                new TaskHandler(this, (TaskContainer)child, childWrapper, target).init(name,
attrs);
               }
               else {
                   new NestedElementHandler(this, child, childWrapper, target).init(name,
attrs);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message