peterreilly    2004/01/13 02:41:48

  Modified:    src/main/org/apache/tools/ant Tag: ANT_16_BRANCH
                        IntrospectionHelper.java
               src/etc/testcases/taskdefs Tag: ANT_16_BRANCH presetdef.xml
               src/testcases/org/apache/tools/ant/taskdefs Tag:
                        ANT_16_BRANCH PreSetDefTest.java
  Log:
  Sync with head
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.65.2.9  +11 -4     
ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
  
  Index: IntrospectionHelper.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
  retrieving revision 1.65.2.8
  retrieving revision 1.65.2.9
  diff -u -r1.65.2.8 -r1.65.2.9
  --- IntrospectionHelper.java  7 Jan 2004 07:32:09 -0000       1.65.2.8
  +++ IntrospectionHelper.java  13 Jan 2004 10:41:47 -0000      1.65.2.9
  @@ -349,19 +349,22 @@
                                   throws InvocationTargetException,
                                   IllegalAccessException, 
InstantiationException {
                                   if (child != null) {
  -                                    return child;
                                   } else if (c.getParameterTypes().length == 
0) {
  -                                    return c.newInstance(new Object[] {});
  +                                    child = c.newInstance(new Object[] {});
                                   } else {
  -                                    return c.newInstance(new Object[] {
  +                                    child = c.newInstance(new Object[] {
                                           project});
                                   }
  +                                if (child instanceof  
PreSetDef.PreSetDefinition) {
  +                                    child = ((PreSetDef.PreSetDefinition) 
child)
  +                                        .createObject(project);
  +                                }
  +                                return child;
                               }
   
                               public void store(Object parent, Object child)
                                   throws InvocationTargetException,
                                   IllegalAccessException, 
InstantiationException {
  -
                                   m.invoke(parent, new Object[] {child});
                               }
   
  @@ -414,6 +417,10 @@
                                   } else {
                                       child = c.newInstance(new Object[] {
                                           project});
  +                                }
  +                                if (child instanceof  
PreSetDef.PreSetDefinition) {
  +                                    child = ((PreSetDef.PreSetDefinition) 
child)
  +                                        .createObject(project);
                                   }
                                   m.invoke(parent, new Object[] {child});
                                   return child;
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +16 -0     ant/src/etc/testcases/taskdefs/presetdef.xml
  
  Index: presetdef.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/presetdef.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- presetdef.xml     6 Nov 2003 09:07:51 -0000       1.1.2.1
  +++ presetdef.xml     13 Jan 2004 10:41:47 -0000      1.1.2.2
  @@ -49,6 +49,22 @@
       <dd attribute="true"/>
     </target>
   
  +  <target name="antTypeTest">
  +    <taskdef name="anttypetest"
  +             
classname="org.apache.tools.ant.taskdefs.PreSetDefTest$AntTypeTest"
  +             classpathref="test-classes"/>
  +    <presetdef name="java.fileset">
  +      <fileset>
  +        <include name="**/*.java"/>
  +      </fileset>
  +    </presetdef>
  +    
  +    <anttypetest>
  +      <fileset ant-type="java.fileset" dir="."/>
  +      <configured ant-type="java.fileset" dir="."/>
  +    </anttypetest>
  +  </target>
  +
     <target name="text.optional">
       <presetdef name="echo.mytext">
         <echo>MyText</echo>
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +16 -1     
ant/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java
  
  Index: PreSetDefTest.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- PreSetDefTest.java        6 Nov 2003 09:07:51 -0000       1.1.2.1
  +++ PreSetDefTest.java        13 Jan 2004 10:41:48 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -58,6 +58,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  +import org.apache.tools.ant.types.FileSet;
   
   /**
    * @author Peter Reilly
  @@ -102,6 +103,10 @@
       public void testElementOrder2() {
           expectLog("element.order2", "Line 1Line 2Line 3");
       }
  +
  +    public void testAntTypeTest() {
  +        expectLog("antTypeTest", "");
  +    }
       
       /**
        * A test class to check default properties
  @@ -119,6 +124,16 @@
   
           public void execute() {
               getProject().log("attribute is " + attribute);
  +        }
  +    }
  +
  +    /**
  +     * A test class to check presetdef with add and addConfigured and 
ant-type
  +     */
  +    public static class AntTypeTest extends Task {
  +        public void addFileSet(FileSet fileset) {
  +        }
  +        public void addConfiguredConfigured(FileSet fileset) {
           }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to