Hi,

A couple of tiny patches:

* addConfigured methods for custom tasks were being called twice.  This
problem was caused by RuntimeConfigurable.maybeConfigure() being called
twice on the task's RuntimeConfigurable - once in
UnknownElement.maybeConfigure(), and once in the custom task's perform()
method.

Changed UnknownElement.execute() to call execute() on the custom task,
rather than perform().

* Whitespace in text content was sometimes being thrown away, depending on
how the SAX parser decided to divide it across calls to
ContentHandler.characters().


Adam
Index: ProjectHelper.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
retrieving revision 1.69
diff -u -r1.69 ProjectHelper.java
--- ProjectHelper.java  2001/12/01 03:33:57     1.69
+++ ProjectHelper.java  2001/12/15 13:55:30
@@ -705,7 +705,7 @@
     public static void addText(Project project, Object target, String text)
         throws BuildException {
 
-        if (text == null || text.trim().length() == 0) {
+        if (text == null ) {
             return;
         }
 
Index: IntrospectionHelper.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
retrieving revision 1.27
diff -u -r1.27 IntrospectionHelper.java
--- IntrospectionHelper.java    2001/12/04 20:34:29     1.27
+++ IntrospectionHelper.java    2001/12/15 13:55:52
@@ -315,10 +315,17 @@
      */
     public void addText(Project project, Object element, String text) {
         if (addText == null) {
-           String msg = getElementName(project, element) +
-           //String msg = "Class " + element.getClass().getName() +
-                " doesn't support nested text data.";
-            throw new BuildException(msg);
+            // Element doesn't handle text content
+            if ( text.trim().length() == 0 ) {
+                // Only whitespace - ignore
+                return;
+            }
+            else {
+                // Not whitespace - fail
+                String msg = getElementName(project, element) +
+                    " doesn't support nested text data.";
+                throw new BuildException(msg);
+            }
         }
         try {
             addText.invoke(element, new String[] {text});
Index: UnknownElement.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/UnknownElement.java,v
retrieving revision 1.16
diff -u -r1.16 UnknownElement.java
--- UnknownElement.java 2001/12/14 11:15:42     1.16
+++ UnknownElement.java 2001/12/15 13:56:09
@@ -125,7 +125,7 @@
         }
 
         if (realThing instanceof Task) {
-            ((Task) realThing).perform();
+            ((Task) realThing).execute();
         }
     }
 

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

Reply via email to