[cp-patches] FYI: PR21869 More CPStringBuilder fixes

Andrew John Hughes gnu_andrew at member.fsf.org
Wed Apr 30 23:26:31 UTC 2008


More moves from StringBuffer to CPStringBuilder:

2008-05-01  Andrew John Hughes  <gnu_andrew at member.fsf.org>

	PR classpath/21869
	* gnu/xml/libxmlj/dom/GnomeAttr.java,
	* gnu/xml/libxmlj/dom/GnomeCharacterData.java,
	* gnu/xml/libxmlj/dom/GnomeDocument.java,
	* gnu/xml/libxmlj/dom/GnomeDocumentType.java,
	* gnu/xml/libxmlj/dom/GnomeElement.java,
	* gnu/xml/libxmlj/dom/GnomeEntity.java,
	* gnu/xml/libxmlj/dom/GnomeNode.java,
	* gnu/xml/libxmlj/dom/GnomeNotation.java,
	* gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java,
	* gnu/xml/libxmlj/dom/GnomeText.java,
	* gnu/xml/libxmlj/dom/GnomeXPathResult.java:
	Swap use of StringBuffer for CPStringBuilder.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
-------------- next part --------------
Index: gnu/xml/libxmlj/dom/GnomeAttr.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeAttr.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeAttr.java
--- gnu/xml/libxmlj/dom/GnomeAttr.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeAttr.java	30 Apr 2008 20:41:40 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
@@ -103,7 +105,7 @@
 
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer(getClass().getName());
+    CPStringBuilder buffer = new CPStringBuilder(getClass().getName());
     buffer.append("[name=");
     buffer.append(getName());
     buffer.append(",value=");
Index: gnu/xml/libxmlj/dom/GnomeCharacterData.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeCharacterData.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeCharacterData.java
--- gnu/xml/libxmlj/dom/GnomeCharacterData.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeCharacterData.java	30 Apr 2008 20:41:40 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.CharacterData;
 import org.w3c.dom.DOMException;
 
@@ -107,7 +109,7 @@
 
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer(getClass().getName());
+    CPStringBuilder buffer = new CPStringBuilder(getClass().getName());
     buffer.append("[data=");
     buffer.append(getData());
     buffer.append("]");
Index: gnu/xml/libxmlj/dom/GnomeDocument.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeDocument.java,v
retrieving revision 1.4
diff -u -r1.4 GnomeDocument.java
--- gnu/xml/libxmlj/dom/GnomeDocument.java	14 Sep 2005 16:52:08 -0000	1.4
+++ gnu/xml/libxmlj/dom/GnomeDocument.java	30 Apr 2008 20:41:40 -0000
@@ -37,6 +37,9 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+import gnu.xml.dom.DomNodeIterator;
+
 import java.util.Iterator;
 
 import org.w3c.dom.Attr;
@@ -66,8 +69,6 @@
 import org.w3c.dom.xpath.XPathExpression;
 import org.w3c.dom.xpath.XPathNSResolver;
 
-import gnu.xml.dom.DomNodeIterator;
-
 /**
  * A DOM document node implemented in libxml2.
  *
@@ -549,7 +550,7 @@
   
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer(getClass().getName());
+    CPStringBuilder buffer = new CPStringBuilder(getClass().getName());
     buffer.append("[version=");
     buffer.append(getXmlVersion());
     buffer.append(",standalone=");
Index: gnu/xml/libxmlj/dom/GnomeDocumentType.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeDocumentType.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeDocumentType.java
--- gnu/xml/libxmlj/dom/GnomeDocumentType.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeDocumentType.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.NamedNodeMap;
 
@@ -79,7 +81,7 @@
   public String toString ()
   {
     String publicId = getPublicId ();
-    StringBuffer buffer = new StringBuffer (getClass ().getName ());
+    CPStringBuilder buffer = new CPStringBuilder (getClass ().getName ());
     buffer.append ("[");
     if (publicId != null)
       {
Index: gnu/xml/libxmlj/dom/GnomeElement.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeElement.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeElement.java
--- gnu/xml/libxmlj/dom/GnomeElement.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeElement.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import java.util.HashSet;
 import java.util.Set;
 
@@ -172,7 +174,7 @@
 
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer(getClass().getName());
+    CPStringBuilder buffer = new CPStringBuilder(getClass().getName());
     buffer.append("[tagName=");
     buffer.append(getTagName());
     buffer.append("]");
Index: gnu/xml/libxmlj/dom/GnomeEntity.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeEntity.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeEntity.java
--- gnu/xml/libxmlj/dom/GnomeEntity.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeEntity.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.Entity;
 
 /**
@@ -83,7 +85,7 @@
   public String toString ()
   {
     String publicId = getPublicId ();
-    StringBuffer buffer = new StringBuffer (getClass ().getName ());
+    CPStringBuilder buffer = new CPStringBuilder (getClass ().getName ());
     buffer.append ("[");
     if (publicId != null)
       {
Index: gnu/xml/libxmlj/dom/GnomeNode.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeNode.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeNode.java
--- gnu/xml/libxmlj/dom/GnomeNode.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeNode.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -368,7 +370,7 @@
       case ENTITY_NODE:
       case ENTITY_REFERENCE_NODE:
       case DOCUMENT_FRAGMENT_NODE:
-        StringBuffer buffer = new StringBuffer();
+        CPStringBuilder buffer = new CPStringBuilder();
         NodeList children = getChildNodes();
         int len = children.getLength();
         for (int i = 0; i < len; i++)
@@ -489,7 +491,7 @@
 
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer(getClass().getName());
+    CPStringBuilder buffer = new CPStringBuilder(getClass().getName());
     buffer.append("[nodeName=");
     buffer.append(getNodeName());
     buffer.append("]");
Index: gnu/xml/libxmlj/dom/GnomeNotation.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeNotation.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeNotation.java
--- gnu/xml/libxmlj/dom/GnomeNotation.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeNotation.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.Notation;
 
 /**
@@ -61,7 +63,7 @@
   public String toString ()
   {
     String publicId = getPublicId ();
-    StringBuffer buffer = new StringBuffer (getClass ().getName ());
+    CPStringBuilder buffer = new CPStringBuilder (getClass ().getName ());
     buffer.append ("[");
     if (publicId != null)
       {
Index: gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeProcessingInstruction.java
--- gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeProcessingInstruction.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.DOMException;
 import org.w3c.dom.ProcessingInstruction;
 
@@ -67,7 +69,7 @@
 
   public String toString ()
   {
-    StringBuffer buffer = new StringBuffer (getClass ().getName ());
+    CPStringBuilder buffer = new CPStringBuilder (getClass ().getName ());
     buffer.append ("[data=");
     buffer.append (getData ());
     buffer.append ("]");
Index: gnu/xml/libxmlj/dom/GnomeText.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeText.java,v
retrieving revision 1.2
diff -u -r1.2 GnomeText.java
--- gnu/xml/libxmlj/dom/GnomeText.java	2 Jul 2005 20:32:16 -0000	1.2
+++ gnu/xml/libxmlj/dom/GnomeText.java	30 Apr 2008 20:41:41 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
@@ -84,7 +86,7 @@
         first = node;
         node = node.getPreviousSibling ();
       }
-    StringBuffer buf = new StringBuffer (first.getNodeValue ());
+    CPStringBuilder buf = new CPStringBuilder (first.getNodeValue ());
     node = first.getNextSibling ();
     while (node != null && node instanceof Text)
       {
Index: gnu/xml/libxmlj/dom/GnomeXPathResult.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/libxmlj/dom/GnomeXPathResult.java,v
retrieving revision 1.3
diff -u -r1.3 GnomeXPathResult.java
--- gnu/xml/libxmlj/dom/GnomeXPathResult.java	11 Jan 2008 21:22:59 -0000	1.3
+++ gnu/xml/libxmlj/dom/GnomeXPathResult.java	30 Apr 2008 20:41:43 -0000
@@ -37,6 +37,8 @@
 
 package gnu.xml.libxmlj.dom;
 
+import gnu.java.lang.CPStringBuilder;
+
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Node;
 import org.w3c.dom.xpath.XPathException;
@@ -112,7 +114,7 @@
         case 1:
           return getSingleNodeValue ().toString ();
         default:
-          StringBuffer buffer = new StringBuffer ();
+          CPStringBuilder buffer = new CPStringBuilder ();
           for (int i = 0; i < len; i++)
             {
               if (i > 0)


More information about the Classpath-patches mailing list