From 6adf82b1031640fe3e37ab9f4b62026ae68e2cc1 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Mon, 5 May 2008 22:21:11 +0000 Subject: 2008-05-05 Andrew John Hughes PR classpath/21869 * gnu/java/lang/CPStringBuilder.java: (substring(int)): Added. * gnu/javax/naming/giop/CorbalocParser.java, * gnu/javax/naming/giop/GiopNamingServiceFactory.java, * gnu/javax/naming/giop/ListBindingsEnumeration.java, * gnu/javax/naming/giop/ListEnumeration.java, * gnu/javax/naming/ictxImpl/trans/GnuName.java, * gnu/javax/net/ssl/PrivateCredentials.java, * gnu/javax/net/ssl/Session.java, * gnu/javax/net/ssl/provider/HelloRequest.java, * gnu/javax/net/ssl/provider/Util.java, * gnu/javax/print/ipp/attribute/RequestedAttributes.java, * gnu/javax/rmi/CORBA/RmiUtilities.java, * gnu/javax/security/auth/callback/AWTCallbackHandler.java, * gnu/javax/security/auth/login/ConfigFileTokenizer.java, * gnu/javax/sound/sampled/gstreamer/io/GstAudioFileReader.java: Swap use of StringBuffer for CPStringBuilder, --- gnu/javax/net/ssl/PrivateCredentials.java | 6 ++++-- gnu/javax/net/ssl/Session.java | 6 ++++-- gnu/javax/net/ssl/provider/HelloRequest.java | 4 +++- gnu/javax/net/ssl/provider/Util.java | 10 ++++++---- 4 files changed, 17 insertions(+), 9 deletions(-) (limited to 'gnu/javax/net') diff --git a/gnu/javax/net/ssl/PrivateCredentials.java b/gnu/javax/net/ssl/PrivateCredentials.java index 4a37cd8b1..7fff253dd 100644 --- a/gnu/javax/net/ssl/PrivateCredentials.java +++ b/gnu/javax/net/ssl/PrivateCredentials.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.net.ssl; +import gnu.java.lang.CPStringBuilder; + import java.io.EOFException; import java.io.InputStream; import java.io.IOException; @@ -137,7 +139,7 @@ public class PrivateCredentials implements ManagerFactoryParameters boolean encrypted = false; String cipher = null; String salt = null; - StringBuffer base64 = new StringBuffer(); + CPStringBuilder base64 = new CPStringBuilder(); while (true) { line = readLine(privateKey); @@ -235,7 +237,7 @@ public class PrivateCredentials implements ManagerFactoryParameters private String readLine(InputStream in) throws IOException { boolean eol_is_cr = System.getProperty("line.separator").equals("\r"); - StringBuffer str = new StringBuffer(); + CPStringBuilder str = new CPStringBuilder(); while (true) { int i = in.read(); diff --git a/gnu/javax/net/ssl/Session.java b/gnu/javax/net/ssl/Session.java index e2b21aa1e..09b50eef0 100644 --- a/gnu/javax/net/ssl/Session.java +++ b/gnu/javax/net/ssl/Session.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.net.ssl; +import gnu.java.lang.CPStringBuilder; + import java.io.Serializable; import java.security.Principal; @@ -349,7 +351,7 @@ public abstract class Session implements SSLSession, Serializable public String toString() { - StringBuffer str = new StringBuffer (3 * id.length + 1); + CPStringBuilder str = new CPStringBuilder (3 * id.length + 1); for (int i = 0; i < id.length; i++) { int x = id[i] & 0xFF; @@ -361,4 +363,4 @@ public abstract class Session implements SSLSession, Serializable return str.toString (); } } -} \ No newline at end of file +} diff --git a/gnu/javax/net/ssl/provider/HelloRequest.java b/gnu/javax/net/ssl/provider/HelloRequest.java index 0ffc26c2b..81dfce591 100644 --- a/gnu/javax/net/ssl/provider/HelloRequest.java +++ b/gnu/javax/net/ssl/provider/HelloRequest.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.net.ssl.provider; +import gnu.java.lang.CPStringBuilder; + /** * The handshake body for a HelloRequest handshake message. * @@ -51,7 +53,7 @@ public final class HelloRequest implements Handshake.Body public String toString (final String prefix) { - StringBuffer str = new StringBuffer (); + CPStringBuilder str = new CPStringBuilder (); if (prefix != null) str.append (prefix); str.append ("HelloRequest { };"); diff --git a/gnu/javax/net/ssl/provider/Util.java b/gnu/javax/net/ssl/provider/Util.java index ba8ea7db7..57f637c18 100644 --- a/gnu/javax/net/ssl/provider/Util.java +++ b/gnu/javax/net/ssl/provider/Util.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.net.ssl.provider; +import gnu.java.lang.CPStringBuilder; + import java.io.PrintWriter; import java.io.StringWriter; @@ -128,7 +130,7 @@ public final class Util */ public static String toHexString(byte[] buf, int off, int len) { - StringBuffer str = new StringBuffer(); + CPStringBuilder str = new CPStringBuilder(); for (int i = 0; i < len; i++) { str.append(HEX.charAt(buf[i+off] >>> 4 & 0x0F)); @@ -157,7 +159,7 @@ public final class Util */ public static String toHexString(byte[] buf, int off, int len, char sep) { - StringBuffer str = new StringBuffer(); + CPStringBuilder str = new CPStringBuilder(); for (int i = 0; i < len; i++) { str.append(HEX.charAt(buf[i+off] >>> 4 & 0x0F)); @@ -194,7 +196,7 @@ public final class Util public static String hexDump(byte[] buf, int off, int len, String prefix) { String nl = getProperty("line.separator"); - StringBuffer str = new StringBuffer(); + CPStringBuilder str = new CPStringBuilder(); int i = 0; while (i < len) { @@ -294,7 +296,7 @@ public final class Util public static String formatInt(int i, int radix, int len) { String s = Integer.toString(i, radix); - StringBuffer buf = new StringBuffer(); + CPStringBuilder buf = new CPStringBuilder(); for (int j = 0; j < len - s.length(); j++) buf.append("0"); buf.append(s); -- cgit v1.2.1