This moves some classes using StringBuffer to CPStringBuilder. ChangeLog:
2008-03-16 Andrew John Hughes <[EMAIL PROTECTED]>
* gnu/xml/dom/DomAttr.java,
* gnu/xml/dom/DomEvent.java,
* gnu/xml/dom/DomNode.java,
* gnu/xml/dom/DomText.java,
* gnu/xml/dom/ls/DomLSInput.java,
* gnu/xml/util/DoParse.java,
* gnu/xml/util/XCat.java:
Use CPStringBuilder in preference to StringBuffer.
--
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
Index: gnu/xml/dom/DomAttr.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/dom/DomAttr.java,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 DomAttr.java
--- gnu/xml/dom/DomAttr.java 6 Dec 2006 18:38:06 -0000 1.4
+++ gnu/xml/dom/DomAttr.java 16 Mar 2008 23:30:48 -0000
@@ -37,6 +37,8 @@ exception statement from your version. *
package gnu.xml.dom;
+import gnu.java.lang.CPStringBuilder;
+
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
@@ -147,7 +149,7 @@ public class DomAttr
return (value == null) ? "" : value;
}
// Otherwise collect child node-values
- StringBuffer buf = new StringBuffer();
+ CPStringBuilder buf = new CPStringBuilder();
for (DomNode ctx = first; ctx != null; ctx = ctx.next)
{
switch (ctx.nodeType)
Index: gnu/xml/dom/DomEvent.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/dom/DomEvent.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 DomEvent.java
--- gnu/xml/dom/DomEvent.java 2 Jul 2005 20:32:15 -0000 1.2
+++ gnu/xml/dom/DomEvent.java 16 Mar 2008 23:30:48 -0000
@@ -37,8 +37,15 @@ exception statement from your version. *
package gnu.xml.dom;
-import org.w3c.dom.*;
-import org.w3c.dom.events.*;
+import gnu.java.lang.CPStringBuilder;
+
+import org.w3c.dom.Node;
+
+import org.w3c.dom.events.Event;
+import org.w3c.dom.events.EventTarget;
+import org.w3c.dom.events.MutationEvent;
+import org.w3c.dom.events.UIEvent;
+
import org.w3c.dom.views.AbstractView; // used by UIEvent
/**
@@ -180,7 +187,7 @@ public class DomEvent
*/
public String toString()
{
- StringBuffer buf = new StringBuffer("[Event ");
+ CPStringBuilder buf = new CPStringBuilder("[Event ");
buf.append(type);
switch (eventPhase)
{
Index: gnu/xml/dom/DomNode.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/dom/DomNode.java,v
retrieving revision 1.18
diff -u -3 -p -u -r1.18 DomNode.java
--- gnu/xml/dom/DomNode.java 1 Jun 2007 09:43:54 -0000 1.18
+++ gnu/xml/dom/DomNode.java 16 Mar 2008 23:30:48 -0000
@@ -37,6 +37,8 @@ exception statement from your version. *
package gnu.xml.dom;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -1939,7 +1941,7 @@ public abstract class DomNode
case ENTITY_NODE:
case ENTITY_REFERENCE_NODE:
case DOCUMENT_FRAGMENT_NODE:
- StringBuffer buffer = new StringBuffer();
+ CPStringBuilder buffer = new CPStringBuilder();
for (DomNode ctx = first; ctx != null; ctx = ctx.next)
{
String textContent = ctx.getTextContent(false);
@@ -2124,7 +2126,7 @@ public abstract class DomNode
{
String nodeName = getNodeName();
String nodeValue = getNodeValue();
- StringBuffer buf = new StringBuffer(getClass().getName());
+ CPStringBuilder buf = new CPStringBuilder(getClass().getName());
buf.append('[');
if (nodeName != null)
{
@@ -2146,7 +2148,7 @@ public abstract class DomNode
String encode(String value)
{
- StringBuffer buf = null;
+ CPStringBuilder buf = null;
int len = value.length();
for (int i = 0; i < len; i++)
{
@@ -2155,7 +2157,7 @@ public abstract class DomNode
{
if (buf == null)
{
- buf = new StringBuffer(value.substring(0, i));
+ buf = new CPStringBuilder(value.substring(0, i));
}
buf.append("\\n");
}
@@ -2163,7 +2165,7 @@ public abstract class DomNode
{
if (buf == null)
{
- buf = new StringBuffer(value.substring(0, i));
+ buf = new CPStringBuilder(value.substring(0, i));
}
buf.append("\\r");
}
Index: gnu/xml/dom/DomText.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/dom/DomText.java,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 DomText.java
--- gnu/xml/dom/DomText.java 2 Jul 2005 20:32:15 -0000 1.3
+++ gnu/xml/dom/DomText.java 16 Mar 2008 23:30:48 -0000
@@ -37,6 +37,8 @@ exception statement from your version. *
package gnu.xml.dom;
+import gnu.java.lang.CPStringBuilder;
+
import org.w3c.dom.DOMException;
import org.w3c.dom.Text;
@@ -172,7 +174,7 @@ public class DomText
{
ref = ctx;
}
- StringBuffer buf = new StringBuffer(ref.getNodeValue());
+ CPStringBuilder buf = new CPStringBuilder(ref.getNodeValue());
for (ctx = ref.next; ctx != null &&
(ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
ctx = ctx.next)
Index: gnu/xml/dom/ls/DomLSInput.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/dom/ls/DomLSInput.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 DomLSInput.java
--- gnu/xml/dom/ls/DomLSInput.java 2 Jul 2005 20:32:16 -0000 1.2
+++ gnu/xml/dom/ls/DomLSInput.java 16 Mar 2008 23:30:48 -0000
@@ -37,6 +37,8 @@ exception statement from your version. *
package gnu.xml.dom.ls;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
@@ -82,7 +84,7 @@ public class DomLSInput
public String getStringData()
{
- StringBuffer acc = new StringBuffer();
+ CPStringBuilder acc = new CPStringBuilder();
Reader reader = getCharacterStream();
try
{
Index: gnu/xml/util/DoParse.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/util/DoParse.java,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 DoParse.java
--- gnu/xml/util/DoParse.java 2 Jul 2005 20:32:21 -0000 1.3
+++ gnu/xml/util/DoParse.java 16 Mar 2008 23:30:48 -0000
@@ -37,6 +37,8 @@ exception statement from your version. *
package gnu.xml.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import org.xml.sax.ErrorHandler;
@@ -271,7 +273,7 @@ final public class DoParse
String label,
SAXParseException e
) {
- StringBuffer buf = new StringBuffer ();
+ CPStringBuilder buf = new CPStringBuilder ();
int temp;
buf.append ("** ");
Index: gnu/xml/util/XCat.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/util/XCat.java,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 XCat.java
--- gnu/xml/util/XCat.java 19 Dec 2006 01:14:24 -0000 1.3
+++ gnu/xml/util/XCat.java 16 Mar 2008 23:30:51 -0000
@@ -38,6 +38,8 @@ exception statement from your version. *
package gnu.xml.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URL;
@@ -623,7 +625,7 @@ public class XCat implements EntityResol
private static String normalizePublicId (boolean full, String publicId)
{
if (publicId.startsWith ("urn:publicid:")) {
- StringBuffer buf = new StringBuffer ();
+ CPStringBuilder buf = new CPStringBuilder ();
char chars [] = publicId.toCharArray ();
boolean hasbug = false;
@@ -814,7 +816,7 @@ System.err.println ("nyet unhexing publi
replace = (String) rewrites.get (temp);
}
if (prefix != null) {
- StringBuffer buf = new StringBuffer (replace);
+ CPStringBuilder buf = new CPStringBuilder (replace);
buf.append (uri.substring (prefixLen));
// IF the URI is accessible ...
return new InputSource (buf.toString ());
signature.asc
Description: Digital signature
