From ac3eefa92a84ff030a60a762f72e5c1ef7b6009c Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 19 Mar 2009 19:53:53 +0000 Subject: [PATCH] Fixed potential thread-safety issue. Credits to Sebb git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@756157 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/http/impl/client/AbstractHttpClient.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java index 2aa14b73e..51ef59212 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java @@ -421,8 +421,7 @@ public abstract class AbstractHttpClient implements HttpClient { } - // TODO - should this be synch? Is remove MT safe? - public void removeResponseInterceptorByClass(Class clazz) { + public synchronized void removeResponseInterceptorByClass(Class clazz) { getHttpProcessor().removeResponseInterceptorByClass(clazz); } @@ -452,8 +451,7 @@ public abstract class AbstractHttpClient implements HttpClient { } - // TODO - should this be synch? Is remove MT safe? - public void removeRequestInterceptorByClass(Class clazz) { + public synchronized void removeRequestInterceptorByClass(Class clazz) { getHttpProcessor().removeRequestInterceptorByClass(clazz); }