hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r615228 - in /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: client/ client/utils/ conn/ conn/routing/ cookie/ impl/client/ impl/cookie/
Date Fri, 25 Jan 2008 14:12:41 GMT
Author: olegk
Date: Fri Jan 25 06:12:39 2008
New Revision: 615228

URL: http://svn.apache.org/viewvc?rev=615228&view=rev
Log:
Replaced CharArrayBuffer with the JRE standard StringBuilder in all instances where CharArrayBuffer
is not being used for building HTTP headers

Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/AuthState.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/Scheme.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRoute.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/RouteTracker.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieOrigin.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/AuthState.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/AuthState.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/AuthState.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/AuthState.java
Fri Jan 25 06:12:39 2008
@@ -33,7 +33,6 @@
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
-import org.apache.http.util.CharArrayBuffer;
 
 /**
  * This class provides detailed information about the state of the
@@ -134,7 +133,7 @@
 
      
     public String toString() {
-        CharArrayBuffer buffer = new CharArrayBuffer(64);
+        StringBuilder buffer = new StringBuilder();
         buffer.append("auth scope [");
         buffer.append(this.authScope);
         buffer.append("]; credentials set [");

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
Fri Jan 25 06:12:39 2008
@@ -36,7 +36,6 @@
 import org.apache.commons.codec.net.URLCodec;
 import org.apache.http.HttpHost;
 import org.apache.http.NameValuePair;
-import org.apache.http.util.CharArrayBuffer;
 
 /**
  * The home for utility methods that handle various URL encoding tasks.
@@ -108,7 +107,7 @@
      public static String formUrlEncode(
              final NameValuePair[] pairs, 
              final String charset) throws UnsupportedEncodingException {
-        CharArrayBuffer buf = new CharArrayBuffer(32);
+        StringBuilder buf = new StringBuilder();
         for (int i = 0; i < pairs.length; i++) {
             URLCodec codec = new URLCodec();
             NameValuePair pair = pairs[i];

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/Scheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/Scheme.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/Scheme.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/Scheme.java
Fri Jan 25 06:12:39 2008
@@ -30,7 +30,6 @@
  */
 package org.apache.http.conn;
 
-import org.apache.http.util.CharArrayBuffer;
 import org.apache.http.util.LangUtils;
 
 /**
@@ -171,7 +170,7 @@
      */
     public final String toString() {
         if (stringRep == null) {
-            CharArrayBuffer buffer = new CharArrayBuffer(32);
+            StringBuilder buffer = new StringBuilder();
             buffer.append(this.name);
             buffer.append(':');
             buffer.append(Integer.toString(this.defaultPort));

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRoute.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRoute.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRoute.java
Fri Jan 25 06:12:39 2008
@@ -34,8 +34,6 @@
 import java.net.InetAddress;
 
 import org.apache.http.HttpHost;
-import org.apache.http.util.CharArrayBuffer;
-
 
 /**
  * The route for a request.
@@ -495,7 +493,7 @@
      * @return  a human-readable representation of this route
      */
     public final String toString() {
-        CharArrayBuffer cab = new CharArrayBuffer(50 + getHopCount()*30);
+        StringBuilder cab = new StringBuilder(50 + getHopCount()*30);
 
         cab.append("HttpRoute[");
         if (this.localAddress != null) {

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/RouteTracker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/RouteTracker.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/RouteTracker.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/RouteTracker.java
Fri Jan 25 06:12:39 2008
@@ -34,7 +34,6 @@
 import java.net.InetAddress;
 
 import org.apache.http.HttpHost;
-import org.apache.http.util.CharArrayBuffer;
 import org.apache.http.conn.routing.HttpRoute.TunnelType;
 import org.apache.http.conn.routing.HttpRoute.LayerType;
 
@@ -466,7 +465,7 @@
      * @return  a human-readable representation of the tracked route
      */
     public final String toString() {
-        CharArrayBuffer cab = new CharArrayBuffer(50 + getHopCount()*30);
+        StringBuilder cab = new StringBuilder(50 + getHopCount()*30);
 
         cab.append("RouteTracker[");
         if (this.localAddress != null) {

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieOrigin.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieOrigin.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieOrigin.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieOrigin.java
Fri Jan 25 06:12:39 2008
@@ -30,8 +30,6 @@
  */
 package org.apache.http.cookie;
 
-import org.apache.http.util.CharArrayBuffer;
-
 /**
  * CookieOrigin class incapsulates details of an origin server that 
  * are relevant when parsing, validating or matching HTTP cookies.
@@ -91,7 +89,7 @@
 	}
 
     public String toString() {
-        CharArrayBuffer buffer = new CharArrayBuffer(32);
+        StringBuilder buffer = new StringBuilder();
         buffer.append("[");
         if (this.secure) {
             buffer.append("(secure)");

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
Fri Jan 25 06:12:39 2008
@@ -86,7 +86,6 @@
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
-import org.apache.http.util.CharArrayBuffer;
 
 /**
  * Default implementation of a client-side request director.
@@ -788,7 +787,7 @@
             port = scheme.getDefaultPort();
         }
         
-        CharArrayBuffer buffer = new CharArrayBuffer(host.length() + 6);
+        StringBuilder buffer = new StringBuilder(host.length() + 6);
         buffer.append(host);
         buffer.append(":");
         buffer.append(Integer.toString(port));

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java?rev=615228&r1=615227&r2=615228&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
Fri Jan 25 06:12:39 2008
@@ -37,7 +37,6 @@
 
 import org.apache.http.cookie.ClientCookie;
 import org.apache.http.cookie.SetCookie;
-import org.apache.http.util.CharArrayBuffer;
 
 /**
  * HTTP "magic-cookie" represents a piece of state information
@@ -313,7 +312,7 @@
     }
 
     public String toString() {
-        CharArrayBuffer buffer = new CharArrayBuffer(64);
+        StringBuilder buffer = new StringBuilder();
         buffer.append("[version: ");
         buffer.append(Integer.toString(this.cookieVersion));
         buffer.append("]");



Mime
View raw message