conor       2003/04/02 03:43:41

  Modified:    src/main/org/apache/tools/ant RuntimeConfigurable.java
                        UnknownElement.java
               src/main/org/apache/tools/ant/taskdefs Sequential.java
  Log:
  Tweak the handling of config of tasks in task containers.
  Tasks in task containers are not configured until they are used.
  Other elements in Task containers (which is now supported by 1.6)
  will be configured when the task container itself is configured.
  
  Remove override in Sequential as it is no longer necessary
  
  Revision  Changes    Path
  1.28      +6 -1      
ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java
  
  Index: RuntimeConfigurable.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -w -u -r1.27 -r1.28
  --- RuntimeConfigurable.java  2 Apr 2003 06:24:34 -0000       1.27
  +++ RuntimeConfigurable.java  2 Apr 2003 11:43:41 -0000       1.28
  @@ -339,7 +339,12 @@
               if (configureChildren) {
                   if (child.wrappedObject instanceof Task) {
                       Task childTask = (Task) child.wrappedObject;
  +                    
  +                    // we don't configure tasks of task containers These
  +                    // we be configured at the time they are used.
  +                    if (!(target instanceof TaskContainer)) {
                       childTask.maybeConfigure();
  +                    }
                   } else {
                       child.maybeConfigure(p);
                   }
  
  
  
  1.44      +1 -6      ant/src/main/org/apache/tools/ant/UnknownElement.java
  
  Index: UnknownElement.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -w -u -r1.43 -r1.44
  --- UnknownElement.java       1 Apr 2003 15:34:38 -0000       1.43
  +++ UnknownElement.java       2 Apr 2003 11:43:41 -0000       1.44
  @@ -144,8 +144,7 @@
           // configure attributes of the object and it's children. If it is
           // a task container, defer the configuration till the task container
           // attempts to use the task
  -        getWrapper().maybeConfigure(getProject(), 
  -            !(realThing instanceof TaskContainer));
  +        getWrapper().maybeConfigure(getProject());
       }
   
       /**
  @@ -305,10 +304,6 @@
               }
   
               child.handleChildren(realChild, childWrapper);
  -
  -//            if (parent instanceof TaskContainer) {
  -//                ((Task) realChild).maybeConfigure();
  -//            }
           }
       }
   
  
  
  
  1.11      +0 -15     
ant/src/main/org/apache/tools/ant/taskdefs/Sequential.java
  
  Index: Sequential.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Sequential.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -u -r1.10 -r1.11
  --- Sequential.java   10 Feb 2003 14:13:36 -0000      1.10
  +++ Sequential.java   2 Apr 2003 11:43:41 -0000       1.11
  @@ -83,21 +83,6 @@
       private Vector nestedTasks = new Vector();
   
       /**
  -     * Override [EMAIL PROTECTED] org.apache.tools.ant.Task#maybeConfigure
  -     * maybeConfigure} in a way that leaves the nested tasks
  -     * unconfigured until they get executed.
  -     *
  -     * @since Ant 1.5
  -     */
  -    public void maybeConfigure() throws BuildException {
  -        if (isInvalid()) {
  -            super.maybeConfigure();
  -        } else {
  -            getRuntimeConfigurableWrapper().maybeConfigure(getProject(), 
false);
  -        }
  -    }
  -
  -    /**
        * Add a nested task to Sequential.
        * <p>
        * @param nestedTask  Nested task to execute Sequential
  
  
  

Reply via email to