From 117ecb1742fe323d01f98523c2d187c56d86fe9c Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 29 Apr 2003 14:16:45 +0000 Subject: [PATCH] Minor doc changes and optimizations git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274535 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/util/DOMElementWriter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java b/src/main/org/apache/tools/ant/util/DOMElementWriter.java index 45d4fd5a4..a11a4efb3 100644 --- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java +++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java @@ -75,7 +75,7 @@ import org.w3c.dom.Text; * * @author The original author of XmlLogger * @author Stefan Bodewig - * @author Stephane Bailliez + * @author Stephane Bailliez */ public class DOMElementWriter { @@ -90,7 +90,7 @@ public class DOMElementWriter { /** * Writes a DOM tree to a stream in UTF8 encoding. Note that - * it appends the <?xml version='1.0' encoding='UTF-8'?>. + * it prepends the <?xml version='1.0' encoding='UTF-8'?>. * The indent number is set to 0 and a 2-space indent. * @param root the root element of the DOM tree. * @param out the outputstream to write to. @@ -105,6 +105,7 @@ public class DOMElementWriter { /** * Writes a DOM tree to a stream. + * * @param element the Root DOM element of the tree * @param out where to send the output * @param indent number of @@ -254,7 +255,8 @@ public class DOMElementWriter { */ public String encodedata(final String value) { StringBuffer sb = new StringBuffer(); - for (int i = 0; i < value.length(); ++i) { + int len = value.length(); + for (int i = 0; i < len; ++i) { char c = value.charAt(i); if (isLegalCharacter(c)) { sb.append(c);