This removes a few uses of StringBuffer in the examples,
replacing them with StringBuilder:
ChangeLog:
2008-05-01 Andrew John Hughes <[EMAIL PROTECTED]>
PR classpath/21869
*
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DemoServant.java,
*
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java,
* examples/gnu/classpath/examples/html/Demo.java:
Swap use of StringBuffer for StringBuilder.
--
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:
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DemoServant.java
===================================================================
RCS file:
/sources/classpath/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DemoServant.java,v
retrieving revision 1.1
diff -u -r1.1 DemoServant.java
---
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DemoServant.java
28 Oct 2005 14:58:47 -0000 1.1
+++
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DemoServant.java
1 May 2008 00:11:28 -0000
@@ -145,7 +145,7 @@
{
System.out.println("SERVER: ***** Transferring tree");
- StringBuffer b = new StringBuffer();
+ StringBuilder b = new StringBuilder();
// This both creates the tree string representation
// and changes the TreeNode names.
@@ -214,7 +214,7 @@
* @param b the buffer to collect the string representation.
* @param n the rott tree TreeNode.
*/
- private void getImage(StringBuffer b, TreeNode n)
+ private void getImage(StringBuilder b, TreeNode n)
{
b.append(n.name);
n.name = n.name + "++";
Index:
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
===================================================================
RCS file:
/sources/classpath/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java,v
retrieving revision 1.3
diff -u -r1.3 DirectTest.java
---
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
28 Oct 2005 14:58:47 -0000 1.3
+++
examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
1 May 2008 00:11:29 -0000
@@ -269,7 +269,7 @@
object.passTree(nh);
// Convert the returned tree to some strig representation.
- StringBuffer img = new StringBuffer();
+ StringBuilder img = new StringBuilder();
getImage(img, nh.value);
System.out.println("Returned tree: " + img.toString());
@@ -314,7 +314,7 @@
* @param b the string buffer to accumulate the representation.
* @param n the tree (root TreeNode).
*/
- private void getImage(StringBuffer b, TreeNode n)
+ private void getImage(StringBuilder b, TreeNode n)
{
b.append(n.name);
b.append(": (");
Index: examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java
===================================================================
RCS file:
/sources/classpath/classpath/examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java,v
retrieving revision 1.1
diff -u -r1.1 IorReader.java
--- examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java 15 Nov
2005 21:16:26 -0000 1.1
+++ examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java 1 May
2008 00:11:29 -0000
@@ -79,7 +79,7 @@
{
InputStreamReader r = new InputStreamReader(u.openStream());
- StringBuffer b = new StringBuffer();
+ StringBuilder b = new StringBuilder();
int c;
while ((c = r.read()) > 0)
Index: examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java
===================================================================
RCS file:
/sources/classpath/classpath/examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java,v
retrieving revision 1.1
diff -u -r1.1 X5Server.java
--- examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java 15 Nov
2005 21:16:26 -0000 1.1
+++ examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java 1 May
2008 00:11:29 -0000
@@ -147,7 +147,7 @@
int length = GameManagerImpl.ior.length();
- StringBuffer b = new StringBuffer();
+ StringBuilder b = new StringBuilder();
b.append("HTTP/1.0 200 OK\r\n");
b.append("Content-Length: " + length + "\r\n");
b.append("Connection: close\r\n");
Index: examples/gnu/classpath/examples/html/Demo.java
===================================================================
RCS file:
/sources/classpath/classpath/examples/gnu/classpath/examples/html/Demo.java,v
retrieving revision 1.2
diff -u -r1.2 Demo.java
--- examples/gnu/classpath/examples/html/Demo.java 2 Jul 2005 20:32:08
-0000 1.2
+++ examples/gnu/classpath/examples/html/Demo.java 1 May 2008 00:11:29
-0000
@@ -94,7 +94,7 @@
if (node == null)
return;
- StringBuffer tab = new StringBuffer();
+ StringBuilder tab = new StringBuilder();
stream.println();
for (int i = 0; i < ident; i++)
{