Browse Source

Minor doc changes and optimizations

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274535 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
117ecb1742
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/main/org/apache/tools/ant/util/DOMElementWriter.java

+ 5
- 3
src/main/org/apache/tools/ant/util/DOMElementWriter.java View File

@@ -75,7 +75,7 @@ import org.w3c.dom.Text;
* *
* @author The original author of XmlLogger * @author The original author of XmlLogger
* @author Stefan Bodewig * @author Stefan Bodewig
* @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</tt>
* @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
*/ */
public class DOMElementWriter { public class DOMElementWriter {


@@ -90,7 +90,7 @@ public class DOMElementWriter {


/** /**
* Writes a DOM tree to a stream in UTF8 encoding. Note that * Writes a DOM tree to a stream in UTF8 encoding. Note that
* it appends the &lt;?xml version='1.0' encoding='UTF-8'?&gt;.
* it prepends the &lt;?xml version='1.0' encoding='UTF-8'?&gt;.
* The indent number is set to 0 and a 2-space indent. * The indent number is set to 0 and a 2-space indent.
* @param root the root element of the DOM tree. * @param root the root element of the DOM tree.
* @param out the outputstream to write to. * @param out the outputstream to write to.
@@ -105,6 +105,7 @@ public class DOMElementWriter {


/** /**
* Writes a DOM tree to a stream. * Writes a DOM tree to a stream.
*
* @param element the Root DOM element of the tree * @param element the Root DOM element of the tree
* @param out where to send the output * @param out where to send the output
* @param indent number of * @param indent number of
@@ -254,7 +255,8 @@ public class DOMElementWriter {
*/ */
public String encodedata(final String value) { public String encodedata(final String value) {
StringBuffer sb = new StringBuffer(); 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); char c = value.charAt(i);
if (isLegalCharacter(c)) { if (isLegalCharacter(c)) {
sb.append(c); sb.append(c);


Loading…
Cancel
Save