commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r929347 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java
Date Wed, 31 Mar 2010 00:30:32 GMT
Author: sebb
Date: Wed Mar 31 00:30:32 2010
New Revision: 929347

URL: http://svn.apache.org/viewvc?rev=929347&view=rev
Log:
Replace instance StringBuffer with local StringBuilder

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java?rev=929347&r1=929346&r2=929347&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/finger/FingerClient.java
Wed Mar 31 00:30:32 2010
@@ -60,7 +60,6 @@ public class FingerClient extends Socket
 
     private static final String __LONG_FLAG = "/W ";
 
-    private transient StringBuffer __query = new StringBuffer(64);
     private transient char[] __buffer = new char[1024];
 
     /***
@@ -159,15 +158,14 @@ public class FingerClient extends Socket
     throws IOException
     {
         DataOutputStream output;
-
-        __query.setLength(0);
+        StringBuilder buffer = new StringBuilder(64);
         if (longOutput)
-            __query.append(__LONG_FLAG);
-        __query.append(username);
-        __query.append(SocketClient.NETASCII_EOL);
+            buffer.append(__LONG_FLAG);
+        buffer.append(username);
+        buffer.append(SocketClient.NETASCII_EOL);
         
         byte[] encodedQuery = 
-                (encoding == null ? __query.toString().getBytes() : __query.toString().getBytes(encoding));
+                (encoding == null ? buffer.toString().getBytes() : buffer.toString().getBytes(encoding));
 
         output = new DataOutputStream(new BufferedOutputStream(_output_, 1024));
         output.write(encodedQuery, 0, encodedQuery.length);



Mime
View raw message