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/taskdefs Ant.java
Date Fri, 02 Nov 2001 12:07:34 GMT
bodewig     01/11/02 04:07:34

  Modified:    src/main/org/apache/tools/ant IntrospectionHelper.java
                        ProjectHelper.java
               src/main/org/apache/tools/ant/taskdefs Ant.java
  Log:
  spread the project instance a little further (this accounts for a
  number of NPEs when using <taskdef> that have been reported).
  
  Revision  Changes    Path
  1.25      +4 -5      jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
  
  Index: IntrospectionHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- IntrospectionHelper.java	2001/10/31 11:04:59	1.24
  +++ IntrospectionHelper.java	2001/11/02 12:07:34	1.25
  @@ -55,7 +55,6 @@
   package org.apache.tools.ant;
   
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.DataType;
   import org.apache.tools.ant.types.EnumeratedAttribute;
   
   import java.lang.reflect.Method;
  @@ -328,8 +327,8 @@
           }
           try {
               Object nestedElement = nc.create(element);
  -            if (nestedElement instanceof DataType) {
  -                ((DataType)nestedElement).setProject(project);
  +            if (nestedElement instanceof ProjectComponent) {
  +                ((ProjectComponent) nestedElement).setProject(project);
               }
               return nestedElement;
           } catch (IllegalAccessException ie) {
  @@ -575,8 +574,8 @@
                               throws InvocationTargetException, IllegalAccessException, BuildException
{
                               try {
                                   Object attribute = c.newInstance(new String[] {value});
  -                                if (attribute instanceof DataType) {
  -                                    ((DataType)attribute).setProject(p);
  +                                if (attribute instanceof ProjectComponent) {
  +                                    ((ProjectComponent) attribute).setProject(p);
                                   }
                                   m.invoke(parent, new Object[] {attribute});
                               } catch (InstantiationException ie) {
  
  
  
  1.67      +4 -2      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.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- ProjectHelper.java	2001/11/02 10:29:52	1.66
  +++ ProjectHelper.java	2001/11/02 12:07:34	1.67
  @@ -561,8 +561,10 @@
               try {
                   String elementName = propType.toLowerCase(Locale.US);
                   if (parent instanceof UnknownElement) {
  -                    child = new UnknownElement(elementName);
  -                    ((UnknownElement) parent).addChild((UnknownElement) child);
  +                    UnknownElement uc = new UnknownElement(elementName);
  +                    uc.setProject(project);
  +                    ((UnknownElement) parent).addChild(uc);
  +                    child = uc;
                   } else {
                       child = ih.createElement(project, parent, elementName);
                   }
  
  
  
  1.32      +1 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Ant.java	2001/10/30 07:07:28	1.31
  +++ Ant.java	2001/11/02 12:07:34	1.32
  @@ -260,6 +260,7 @@
               Enumeration e = properties.elements();
               while (e.hasMoreElements()) {
                   Property p=(Property) e.nextElement();
  +                p.setProject(newProject);
                   p.execute();
               }
               
  
  
  

--
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