hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1354718 - in /httpcomponents/httpcore/trunk: httpcore-nio/src/examples/org/apache/http/examples/nio/ httpcore-nio/src/test/java/org/apache/http/ httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/ httpcore/src/examples/org/apache/...
Date Wed, 27 Jun 2012 20:42:44 GMT
Author: olegk
Date: Wed Jun 27 20:42:41 2012
New Revision: 1354718

URL: http://svn.apache.org/viewvc?rev=1354718&view=rev
Log:
Made BasicHttpParams thread-safe; deprecated SyncBasicHttpParams

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/AbstractHttpMessage.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestDefaultedHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpService.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
Wed Jun 27 20:42:41 2012
@@ -46,10 +46,10 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.HttpAsyncRequester;
 import org.apache.http.nio.reactor.ConnectingIOReactor;
 import org.apache.http.nio.reactor.IOEventDispatch;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -66,7 +66,7 @@ public class NHttpClient {
 
     public static void main(String[] args) throws Exception {
         // HTTP parameters for the client
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 3000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 3000)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
Wed Jun 27 20:42:41 2012
@@ -80,10 +80,10 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.reactor.ConnectingIOReactor;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.ListeningIOReactor;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.pool.PoolStats;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -123,7 +123,7 @@ public class NHttpReverseProxy {
 
         System.out.println("Reverse proxy to " + targetHost);
 
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 30000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
Wed Jun 27 20:42:41 2012
@@ -66,10 +66,10 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.HttpAsyncService;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.ListeningIOReactor;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -97,7 +97,7 @@ public class NHttpServer {
             port = Integer.parseInt(args[1]);
         }
         // HTTP parameters for the server
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
Wed Jun 27 20:42:41 2012
@@ -34,10 +34,10 @@ import org.apache.http.impl.nio.pool.Bas
 import org.apache.http.impl.nio.pool.BasicNIOConnPool;
 import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.protocol.HttpAsyncRequester;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
@@ -75,7 +75,7 @@ public abstract class HttpCoreNIOTestBas
             HttpParams params) throws Exception;
 
     public void initServer() throws Exception {
-        this.serverParams = new SyncBasicHttpParams();
+        this.serverParams = new BasicHttpParams();
         this.serverParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -93,7 +93,7 @@ public abstract class HttpCoreNIOTestBas
     }
 
     public void initClient() throws Exception {
-        this.clientParams = new SyncBasicHttpParams();
+        this.clientParams = new BasicHttpParams();
         this.clientParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
Wed Jun 27 20:42:41 2012
@@ -44,8 +44,8 @@ import org.apache.http.nio.reactor.IORea
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.ListeningIOReactor;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
@@ -61,7 +61,7 @@ import org.junit.Test;
 public class TestDefaultListeningIOReactor {
 
     private static IOEventDispatch createIOEventDispatch() {
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[]
{
                 new ResponseDate(),
                 new ResponseServer(),

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
Wed Jun 27 20:42:41 2012
@@ -37,9 +37,9 @@ import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.message.BasicHttpRequest;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -63,7 +63,7 @@ public class ElementalHttpGet {
 
     public static void main(String[] args) throws Exception {
 
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
         HttpProtocolParams.setContentCharset(params, "UTF-8");
         HttpProtocolParams.setUserAgent(params, "HttpComponents/1.1");

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
Wed Jun 27 20:42:41 2012
@@ -42,9 +42,9 @@ import org.apache.http.entity.StringEnti
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.message.BasicHttpEntityEnclosingRequest;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -68,7 +68,7 @@ public class ElementalHttpPost {
 
     public static void main(String[] args) throws Exception {
 
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
         HttpProtocolParams.setContentCharset(params, "UTF-8");
         HttpProtocolParams.setUserAgent(params, "Test/1.1");

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
Wed Jun 27 20:42:41 2012
@@ -52,10 +52,10 @@ import org.apache.http.entity.StringEnti
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.DefaultHttpServerConnection;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -154,7 +154,7 @@ public class ElementalHttpServer {
 
         public RequestListenerThread(int port, final String docroot) throws IOException {
             this.serversocket = new ServerSocket(port);
-            this.params = new SyncBasicHttpParams();
+            this.params = new BasicHttpParams();
             this.params
                 .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
                 .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
Wed Jun 27 20:42:41 2012
@@ -42,9 +42,9 @@ import org.apache.http.impl.pool.BasicCo
 import org.apache.http.impl.pool.BasicConnPool;
 import org.apache.http.impl.pool.BasicPoolEntry;
 import org.apache.http.message.BasicHttpRequest;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -69,7 +69,7 @@ public class ElementalPoolingHttpGet {
 
     public static void main(String[] args) throws Exception {
 
-        final HttpParams params = new SyncBasicHttpParams();
+        final HttpParams params = new BasicHttpParams();
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
         HttpProtocolParams.setContentCharset(params, "UTF-8");
         HttpProtocolParams.setUserAgent(params, "Test/1.1");

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
Wed Jun 27 20:42:41 2012
@@ -46,10 +46,10 @@ import org.apache.http.impl.DefaultConne
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.DefaultHttpServerConnection;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HTTP;
@@ -177,7 +177,7 @@ public class ElementalReverseProxy {
         public RequestListenerThread(int port, final HttpHost target) throws IOException
{
             this.target = target;
             this.serversocket = new ServerSocket(port);
-            this.params = new SyncBasicHttpParams();
+            this.params = new BasicHttpParams();
             this.params
                 .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
                 .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/AbstractHttpMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/AbstractHttpMessage.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/AbstractHttpMessage.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/AbstractHttpMessage.java
Wed Jun 27 20:42:41 2012
@@ -31,8 +31,8 @@ import org.apache.http.Header;
 import org.apache.http.HeaderIterator;
 import org.apache.http.HttpMessage;
 import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.params.HttpParams;
 import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpParams;
 
 /**
  * Basic implementation of {@link HttpMessage}.

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
Wed Jun 27 20:42:41 2012
@@ -30,11 +30,11 @@ package org.apache.http.params;
 import java.io.Serializable;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.params.HttpParams;
 
 /**
@@ -45,13 +45,13 @@ import org.apache.http.params.HttpParams
  *
  * @since 4.0
  */
-@NotThreadSafe
+@ThreadSafe
 public class BasicHttpParams extends AbstractHttpParams implements Serializable, Cloneable
{
 
     private static final long serialVersionUID = -7086398485908701455L;
 
     /** Map of HTTP parameters that this collection contains. */
-    private final HashMap<String, Object> parameters = new HashMap<String, Object>();
+    private final Map<String, Object> parameters = new ConcurrentHashMap<String,
Object>();
 
     public BasicHttpParams() {
         super();
@@ -62,7 +62,14 @@ public class BasicHttpParams extends Abs
     }
 
     public HttpParams setParameter(final String name, final Object value) {
-        this.parameters.put(name, value);
+        if (name == null) {
+            return this;
+        }
+        if (value != null) {
+            this.parameters.put(name, value);
+        } else {
+            this.parameters.remove(name);
+        }
         return this;
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
Wed Jun 27 20:42:41 2012
@@ -32,8 +32,11 @@ import org.apache.http.annotation.Thread
  * Thread-safe extension of the {@link BasicHttpParams}.
  *
  * @since 4.1
+ * 
+ * @deprecated (4.3) use {@link BasicHttpParams}.
  */
 @ThreadSafe
+@Deprecated
 public class SyncBasicHttpParams extends BasicHttpParams {
 
     private static final long serialVersionUID = 5387834869062660642L;

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestDefaultedHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestDefaultedHttpParams.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestDefaultedHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestDefaultedHttpParams.java
Wed Jun 27 20:42:41 2012
@@ -91,8 +91,8 @@ public class TestDefaultedHttpParams {
         nameSet = params.getNames();
         localnameSet = params.getLocalNames();
         defaultnameSet = params.getDefaultNames();
-        Assert.assertEquals(4, nameSet.size());
-        Assert.assertEquals(3, localnameSet.size());
+        Assert.assertEquals(3, nameSet.size());
+        Assert.assertEquals(2, localnameSet.size());
         Assert.assertEquals(2, defaultnameSet.size());
     }
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpService.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpService.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpService.java
Wed Jun 27 20:42:41 2012
@@ -45,8 +45,8 @@ import org.apache.http.entity.InputStrea
 import org.apache.http.message.BasicHttpEntityEnclosingRequest;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.message.BasicHttpResponse;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -59,7 +59,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
         try {
             new HttpService(
                     null,
@@ -108,7 +108,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -146,7 +146,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -173,7 +173,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -200,7 +200,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -244,7 +244,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -292,7 +292,7 @@ public class TestHttpService {
         ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpExpectationVerifier expectationVerifier = new HttpExpectationVerifier() {
 
@@ -349,7 +349,7 @@ public class TestHttpService {
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpExpectationVerifier expectationVerifier = Mockito.mock(HttpExpectationVerifier.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -398,7 +398,7 @@ public class TestHttpService {
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
         HttpRequestHandler requestHandler = Mockito.mock(HttpRequestHandler.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -443,7 +443,7 @@ public class TestHttpService {
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
         HttpRequestHandler requestHandler = Mockito.mock(HttpRequestHandler.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -488,7 +488,7 @@ public class TestHttpService {
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
         HttpRequestHandler requestHandler = Mockito.mock(HttpRequestHandler.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,
@@ -533,7 +533,7 @@ public class TestHttpService {
         HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
         HttpRequestHandlerResolver handlerResolver = Mockito.mock(HttpRequestHandlerResolver.class);
         HttpRequestHandler requestHandler = Mockito.mock(HttpRequestHandler.class);
-        HttpParams params = new SyncBasicHttpParams();
+        HttpParams params = new BasicHttpParams();
 
         HttpService httpservice = new HttpService(
                 httprocessor,

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
Wed Jun 27 20:42:41 2012
@@ -38,14 +38,14 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.DefaultedHttpParams;
-import org.apache.http.params.SyncBasicHttpParams;
-import org.apache.http.protocol.HttpContext;
+import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
+import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -67,7 +67,7 @@ public class HttpClient {
         super();
         this.httpproc = httpproc;
         this.connStrategy = new DefaultConnectionReuseStrategy();
-        this.params = new SyncBasicHttpParams();
+        this.params = new BasicHttpParams();
         this.params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false)

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java?rev=1354718&r1=1354717&r2=1354718&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
Wed Jun 27 20:42:41 2012
@@ -42,12 +42,12 @@ import org.apache.http.HttpServerConnect
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.DefaultHttpServerConnection;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.SyncBasicHttpParams;
-import org.apache.http.protocol.HttpContext;
+import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
@@ -75,7 +75,7 @@ public class HttpServer {
 
     public HttpServer() throws IOException {
         super();
-        this.params = new SyncBasicHttpParams();
+        this.params = new BasicHttpParams();
         this.params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)



Mime
View raw message