unico       2004/07/22 14:07:35

  Modified:    webdavclient/clientlib/src/java/org/apache/util
                        DOMUtils.java
  Log:
  use string buffer
  
  Revision  Changes    Path
  1.5       +11 -11    
jakarta-slide/webdavclient/clientlib/src/java/org/apache/util/DOMUtils.java
  
  Index: DOMUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/util/DOMUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMUtils.java     16 Jul 2004 22:46:30 -0000      1.4
  +++ DOMUtils.java     22 Jul 2004 21:07:35 -0000      1.5
  @@ -148,16 +148,16 @@
   
           // I *thought* that I should be able to use element.getNodeValue()...
   
  -        String text = "";
  -        NodeList textList = node.getChildNodes();
  -        for (int i = 0; i < textList.getLength(); i++) {
  -            if (textList.item(i).getNodeType() == Node.TEXT_NODE) {
  -                text += ((Text) textList.item(i)).getData();
  +        StringBuffer text = new StringBuffer();
  +        NodeList nodeList = node.getChildNodes();
  +        for (int i = 0; i < nodeList.getLength(); i++) {
  +            if (nodeList.item(i).getNodeType() == Node.TEXT_NODE) {
  +                text.append(((Text) nodeList.item(i)).getData());
               } else {
  -                text += getTextValue(textList.item(i));
  +                text.append(getTextValue(nodeList.item(i)));
               }
           }
  -        return text;
  +        return text.toString();
       }
   
       /**
  
  
  

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

Reply via email to