bodewig 01/12/18 12:19:07 Modified: src/main/org/apache/tools/ant IntrospectionHelper.java ProjectHelper.java UnknownElement.java Log: * 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. * Whitespace in text content was sometimes being thrown away, depending on how the SAX parser decided to divide it across calls to ContentHandler.characters(). Submitted by: Adam Murdoch <[EMAIL PROTECTED]> Revision Changes Path 1.28 +11 -4 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.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- IntrospectionHelper.java 2001/12/04 20:34:29 1.27 +++ IntrospectionHelper.java 2001/12/18 20:19:07 1.28 @@ -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}); 1.70 +1 -1 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.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- ProjectHelper.java 2001/12/01 03:33:57 1.69 +++ ProjectHelper.java 2001/12/18 20:19:07 1.70 @@ -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; } 1.17 +1 -1 jakarta-ant/src/main/org/apache/tools/ant/UnknownElement.java Index: UnknownElement.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/UnknownElement.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- UnknownElement.java 2001/12/14 11:15:42 1.16 +++ UnknownElement.java 2001/12/18 20:19:07 1.17 @@ -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]>