summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-07 00:18:12 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-07 00:18:12 +0000
commit998631591c593065ebc14c556fbe73b900e18b71 (patch)
tree6855c130ab313626da16dc5398dd81243aa1cc33
parentbe7ec498b9f7468d6d526c287a774c2be20ac407 (diff)
downloadclasspath-998631591c593065ebc14c556fbe73b900e18b71.tar.gz
2008-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/21869 * javax/accessibility/AccessibleRelationSet.java, * javax/accessibility/AccessibleStateSet.java, * javax/imageio/plugins/jpeg/JPEGHuffmanTable.java, * javax/imageio/plugins/jpeg/JPEGQTable.java, * javax/imageio/stream/ImageInputStreamImpl.java, * javax/management/ObjectName.java, * javax/naming/BinaryRefAddr.java, * javax/naming/CompositeName.java, * javax/naming/CompoundName.java, * javax/naming/NamingException.java, * javax/naming/spi/NamingManager.java, * javax/security/auth/x500/X500Principal.java, * javax/security/sasl/SaslException.java, * javax/sound/sampled/AudioFormat.java, * javax/sound/sampled/CompoundControl.java, * javax/sound/sampled/DataLine.java: Swap use of StringBuffer for CPStringBuilder.
-rw-r--r--ChangeLog21
-rw-r--r--javax/accessibility/AccessibleRelationSet.java4
-rw-r--r--javax/accessibility/AccessibleStateSet.java4
-rw-r--r--javax/imageio/plugins/jpeg/JPEGHuffmanTable.java4
-rw-r--r--javax/imageio/plugins/jpeg/JPEGQTable.java4
-rw-r--r--javax/imageio/stream/ImageInputStreamImpl.java4
-rw-r--r--javax/management/ObjectName.java10
-rw-r--r--javax/naming/BinaryRefAddr.java4
-rw-r--r--javax/naming/CompositeName.java6
-rw-r--r--javax/naming/CompoundName.java6
-rw-r--r--javax/naming/NamingException.java4
-rw-r--r--javax/naming/spi/NamingManager.java4
-rw-r--r--javax/security/auth/x500/X500Principal.java10
-rw-r--r--javax/security/sasl/SaslException.java4
-rw-r--r--javax/sound/sampled/AudioFormat.java4
-rw-r--r--javax/sound/sampled/CompoundControl.java4
-rw-r--r--javax/sound/sampled/DataLine.java4
17 files changed, 77 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index cbea88d0f..9377343c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2008-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ PR classpath/21869
+ * javax/accessibility/AccessibleRelationSet.java,
+ * javax/accessibility/AccessibleStateSet.java,
+ * javax/imageio/plugins/jpeg/JPEGHuffmanTable.java,
+ * javax/imageio/plugins/jpeg/JPEGQTable.java,
+ * javax/imageio/stream/ImageInputStreamImpl.java,
+ * javax/management/ObjectName.java,
+ * javax/naming/BinaryRefAddr.java,
+ * javax/naming/CompositeName.java,
+ * javax/naming/CompoundName.java,
+ * javax/naming/NamingException.java,
+ * javax/naming/spi/NamingManager.java,
+ * javax/security/auth/x500/X500Principal.java,
+ * javax/security/sasl/SaslException.java,
+ * javax/sound/sampled/AudioFormat.java,
+ * javax/sound/sampled/CompoundControl.java,
+ * javax/sound/sampled/DataLine.java:
+ Swap use of StringBuffer for CPStringBuilder.
+
2008-05-06 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/21869
diff --git a/javax/accessibility/AccessibleRelationSet.java b/javax/accessibility/AccessibleRelationSet.java
index 49161d77e..0770fdbeb 100644
--- a/javax/accessibility/AccessibleRelationSet.java
+++ b/javax/accessibility/AccessibleRelationSet.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.accessibility;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.Locale;
import java.util.Vector;
@@ -216,7 +218,7 @@ public class AccessibleRelationSet
if (i == 0)
return "";
// Pre-allocate an average of 10 chars per state.
- StringBuffer b = new StringBuffer(i * 10);
+ CPStringBuilder b = new CPStringBuilder(i * 10);
while (--i >= 0)
b.append(relations.get(i)).append(',');
return b.substring(0, b.length() - 1);
diff --git a/javax/accessibility/AccessibleStateSet.java b/javax/accessibility/AccessibleStateSet.java
index 783f54127..83bf3d491 100644
--- a/javax/accessibility/AccessibleStateSet.java
+++ b/javax/accessibility/AccessibleStateSet.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.accessibility;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.Locale;
import java.util.Vector;
@@ -165,7 +167,7 @@ public class AccessibleStateSet
if (i == 0)
return "";
// Pre-allocate an average of 10 chars per state.
- StringBuffer b = new StringBuffer(i * 10);
+ CPStringBuilder b = new CPStringBuilder(i * 10);
while (--i >= 0)
b.append(states.get(i)).append(',');
return b.substring(0, b.length() - 1);
diff --git a/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java b/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java
index c0567be78..378e11fa6 100644
--- a/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java
+++ b/javax/imageio/plugins/jpeg/JPEGHuffmanTable.java
@@ -38,6 +38,8 @@
package javax.imageio.plugins.jpeg;
+import gnu.java.lang.CPStringBuilder;
+
/**
* The JPEGHuffmanTable class represents a Huffman table read from a
* JPEG image file. The standard JPEG AC and DC chrominance and
@@ -263,7 +265,7 @@ public class JPEGHuffmanTable
*/
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ CPStringBuilder buffer = new CPStringBuilder();
buffer.append("JPEGHuffmanTable:\nlengths:");
diff --git a/javax/imageio/plugins/jpeg/JPEGQTable.java b/javax/imageio/plugins/jpeg/JPEGQTable.java
index a94e8b188..259d0aa64 100644
--- a/javax/imageio/plugins/jpeg/JPEGQTable.java
+++ b/javax/imageio/plugins/jpeg/JPEGQTable.java
@@ -38,6 +38,8 @@
package javax.imageio.plugins.jpeg;
+import gnu.java.lang.CPStringBuilder;
+
/**
* The JPEGQTable class represents a quantization table that can be
* used to encode or decode a JPEG stream. The standard JPEG
@@ -178,7 +180,7 @@ public class JPEGQTable
*/
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ CPStringBuilder buffer = new CPStringBuilder();
buffer.append("JPEGQTable:\n");
for (int i = 0; i < 8; i++)
diff --git a/javax/imageio/stream/ImageInputStreamImpl.java b/javax/imageio/stream/ImageInputStreamImpl.java
index 71eec41a9..e338f1dbe 100644
--- a/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/javax/imageio/stream/ImageInputStreamImpl.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.imageio.stream;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
@@ -341,7 +343,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
int c = -1;
boolean eol = false;
- StringBuffer buffer = new StringBuffer();
+ CPStringBuilder buffer = new CPStringBuilder();
c = read();
if (c == -1)
diff --git a/javax/management/ObjectName.java b/javax/management/ObjectName.java
index 1fb51506f..e44b5c23a 100644
--- a/javax/management/ObjectName.java
+++ b/javax/management/ObjectName.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.management;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Serializable;
import java.util.Hashtable;
@@ -476,7 +478,7 @@ public class ObjectName
*/
public String getCanonicalKeyPropertyListString()
{
- StringBuilder builder = new StringBuilder();
+ CPStringBuilder builder = new CPStringBuilder();
Iterator i = properties.entrySet().iterator();
while (i.hasNext())
{
@@ -795,7 +797,7 @@ public class ObjectName
*/
public static String quote(String string)
{
- StringBuilder builder = new StringBuilder();
+ CPStringBuilder builder = new CPStringBuilder();
builder.append('"');
for (int a = 0; a < string.length(); ++a)
{
@@ -863,7 +865,7 @@ public class ObjectName
throws IOException
{
out.defaultWriteObject();
- StringBuffer buffer = new StringBuffer(getDomain());
+ CPStringBuilder buffer = new CPStringBuilder(getDomain());
buffer.append(':');
String properties = getKeyPropertyListString();
buffer.append(properties);
@@ -924,7 +926,7 @@ public class ObjectName
if (q.charAt(q.length() - 1) != '"')
throw new IllegalArgumentException("The string does " +
"not end with a quote.");
- StringBuilder builder = new StringBuilder();
+ CPStringBuilder builder = new CPStringBuilder();
for (int a = 1; a < (q.length() - 1); ++a)
{
char n = q.charAt(a);
diff --git a/javax/naming/BinaryRefAddr.java b/javax/naming/BinaryRefAddr.java
index 0b813abc3..923c48e23 100644
--- a/javax/naming/BinaryRefAddr.java
+++ b/javax/naming/BinaryRefAddr.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.naming;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.Arrays;
/**
@@ -139,7 +141,7 @@ public class BinaryRefAddr extends RefAddr
*/
public String toString()
{
- StringBuffer sb = new StringBuffer("[RefAddr type: ");
+ CPStringBuilder sb = new CPStringBuilder("[RefAddr type: ");
sb.append(getType());
sb.append(" content: 0x");
byte[] b = (byte[]) getContent();
diff --git a/javax/naming/CompositeName.java b/javax/naming/CompositeName.java
index 7227f9d78..4593bae63 100644
--- a/javax/naming/CompositeName.java
+++ b/javax/naming/CompositeName.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.naming;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -85,7 +87,7 @@ public class CompositeName implements Name, Cloneable, Serializable
final char no_quote = 'x'; // Use 'x' to mean no quoting.
char quote = no_quote;
boolean escaped = false;
- StringBuffer new_element = new StringBuffer ();
+ StringBuilder new_element = new StringBuilder ();
for (int i = 0; i < n.length (); ++i)
{
char c = n.charAt (i);
@@ -294,7 +296,7 @@ public class CompositeName implements Name, Cloneable, Serializable
public String toString ()
{
- StringBuffer result = new StringBuffer ();
+ CPStringBuilder result = new CPStringBuilder ();
for (int i = 0; i < elts.size (); ++i)
{
// For simplicity we choose to always quote using escapes and
diff --git a/javax/naming/CompoundName.java b/javax/naming/CompoundName.java
index f345d3efd..26b44c16f 100644
--- a/javax/naming/CompoundName.java
+++ b/javax/naming/CompoundName.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.naming;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -95,7 +97,7 @@ public class CompoundName implements Name, Cloneable, Serializable
mySyntax = syntax;
initializeSyntax ();
- StringBuffer new_element = new StringBuffer ();
+ StringBuilder new_element = new StringBuilder ();
int i = 0;
// QUOTE==null means no quoting right now. When it is set it is
// the value of the closing quote.
@@ -376,7 +378,7 @@ public class CompoundName implements Name, Cloneable, Serializable
public String toString ()
{
- StringBuffer result = new StringBuffer ();
+ CPStringBuilder result = new CPStringBuilder ();
int size = elts.size ();
for (int i = 0; i < size; ++i)
{
diff --git a/javax/naming/NamingException.java b/javax/naming/NamingException.java
index dbe1e3792..7a5c35eb5 100644
--- a/javax/naming/NamingException.java
+++ b/javax/naming/NamingException.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.naming;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.PrintStream;
import java.io.PrintWriter;
@@ -237,7 +239,7 @@ public class NamingException extends Exception
*/
public String toString(boolean objectInfo)
{
- StringBuffer sb = new StringBuffer(super.toString());
+ CPStringBuilder sb = new CPStringBuilder(super.toString());
Throwable cause = getRootCause();
if (cause != null)
{
diff --git a/javax/naming/spi/NamingManager.java b/javax/naming/spi/NamingManager.java
index 3dfba0f66..cc8d46fa4 100644
--- a/javax/naming/spi/NamingManager.java
+++ b/javax/naming/spi/NamingManager.java
@@ -41,6 +41,8 @@ package javax.naming.spi;
import gnu.classpath.VMStackWalker;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
@@ -197,7 +199,7 @@ public class NamingManager
// The final default location, as specified in the documentation.
String finalPrefix = "com.sun.jndi.url";
- StringBuffer allPrefixes = new StringBuffer();
+ CPStringBuilder allPrefixes = new CPStringBuilder();
String prefixes;
if (environment != null)
diff --git a/javax/security/auth/x500/X500Principal.java b/javax/security/auth/x500/X500Principal.java
index d78b0d3ee..0a1e8c665 100644
--- a/javax/security/auth/x500/X500Principal.java
+++ b/javax/security/auth/x500/X500Principal.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.security.auth.x500;
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.security.OID;
import gnu.java.security.der.DER;
import gnu.java.security.der.DERReader;
@@ -200,7 +202,7 @@ public final class X500Principal implements Principal, Serializable
boolean canon = CANONICAL.equalsIgnoreCase (format);
if (! (rfc2253 || rfc1779 || canon))
throw new IllegalArgumentException ("unsupported format " + format);
- StringBuffer str = new StringBuffer();
+ CPStringBuilder str = new CPStringBuilder();
for (Iterator it = components.iterator(); it.hasNext(); )
{
Map m = (Map) it.next();
@@ -323,7 +325,7 @@ public final class X500Principal implements Principal, Serializable
private String readAttributeType(Reader in) throws IOException
{
- StringBuffer buf = new StringBuffer();
+ CPStringBuilder buf = new CPStringBuilder();
int ch;
while ((ch = in.read()) != '=')
{
@@ -345,7 +347,7 @@ public final class X500Principal implements Principal, Serializable
private String readAttributeValue(Reader in) throws IOException
{
- StringBuffer buf = new StringBuffer();
+ CPStringBuilder buf = new CPStringBuilder();
int ch = in.read();
if (ch == '#')
{
@@ -518,7 +520,7 @@ public final class X500Principal implements Principal, Serializable
private static String compressWS(String str)
{
- StringBuffer buf = new StringBuffer();
+ CPStringBuilder buf = new CPStringBuilder();
char lastChar = 0;
for (int i = 0; i < str.length(); i++)
{
diff --git a/javax/security/sasl/SaslException.java b/javax/security/sasl/SaslException.java
index 89764bb18..f4407e761 100644
--- a/javax/security/sasl/SaslException.java
+++ b/javax/security/sasl/SaslException.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.security.sasl;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
@@ -178,7 +180,7 @@ public class SaslException extends IOException implements Serializable
*/
public String toString()
{
- StringBuffer sb = new StringBuffer(this.getClass().getName())
+ CPStringBuilder sb = new CPStringBuilder(this.getClass().getName())
.append(": ").append(super.toString());
if (_exception != null)
sb.append("; caused by: ").append(_exception.toString());
diff --git a/javax/sound/sampled/AudioFormat.java b/javax/sound/sampled/AudioFormat.java
index 7b6ebc4b0..1f31c9929 100644
--- a/javax/sound/sampled/AudioFormat.java
+++ b/javax/sound/sampled/AudioFormat.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.sound.sampled;
+import gnu.java.lang.CPStringBuilder;
+
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -329,7 +331,7 @@ public class AudioFormat
*/
public String toString()
{
- StringBuffer result = new StringBuffer();
+ CPStringBuilder result = new CPStringBuilder();
// usually at least encoding should be somewhat specified
result.append(encoding);
diff --git a/javax/sound/sampled/CompoundControl.java b/javax/sound/sampled/CompoundControl.java
index 057bdfd72..556c805ad 100644
--- a/javax/sound/sampled/CompoundControl.java
+++ b/javax/sound/sampled/CompoundControl.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.sound.sampled;
+import gnu.java.lang.CPStringBuilder;
+
/**
* A compound control provides control over several other controls.
* @since 1.3
@@ -88,7 +90,7 @@ public abstract class CompoundControl extends Control
*/
public String toString()
{
- StringBuffer result = new StringBuffer();
+ CPStringBuilder result = new CPStringBuilder();
result.append(super.toString());
result.append(": ");
for (int i = 0; i < memberControls.length; ++i)
diff --git a/javax/sound/sampled/DataLine.java b/javax/sound/sampled/DataLine.java
index b7cb70e49..4482c9885 100644
--- a/javax/sound/sampled/DataLine.java
+++ b/javax/sound/sampled/DataLine.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.sound.sampled;
+import gnu.java.lang.CPStringBuilder;
+
/**
* The DataLine interface adds data-related functionality to the Line
* interface. For example, it adds methods to start and stop the data
@@ -180,7 +182,7 @@ public interface DataLine extends Line
*/
public String toString()
{
- StringBuffer result = new StringBuffer();
+ CPStringBuilder result = new CPStringBuilder();
result.append("formats: [");
for (int i = 0; i < formats.length; ++i)
{