Renamed SimpleParamStack to DefaultedHttpParams; removed #isParameterSet method from the HttpParams interface
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@610764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96f2c55a3c
commit
5709949205
|
@ -222,40 +222,6 @@ public class ClientParamsStack extends AbstractHttpParams {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether a parameter is set in this stack.
|
||||
*
|
||||
* @param name the name of the parameter to check for
|
||||
*
|
||||
* @return <code>true</code> if the parameter is set in this stack,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
public boolean isParameterSet(String name) {
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException
|
||||
("Parameter name must not be null.");
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
|
||||
if (overrideParams != null) {
|
||||
found = overrideParams.isParameterSet(name);
|
||||
}
|
||||
if (!found && (requestParams != null)) {
|
||||
found = requestParams.isParameterSet(name);
|
||||
}
|
||||
if (!found && (clientParams != null)) {
|
||||
found = clientParams.isParameterSet(name);
|
||||
}
|
||||
if (!found && (applicationParams != null)) {
|
||||
found = applicationParams.isParameterSet(name);
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Does <i>not</i> set a parameter.
|
||||
* Parameter stacks are read-only. It is possible, though discouraged,
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.http.HttpHost;
|
|||
import org.apache.http.HttpRequest;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.params.SimpleParamStack;
|
||||
import org.apache.http.params.DefaultedHttpParams;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.apache.http.protocol.ExecutionContext;
|
||||
import org.apache.http.protocol.HttpProcessor;
|
||||
|
@ -69,10 +69,10 @@ public final class Helper {
|
|||
ctxt.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
|
||||
ctxt.setAttribute(ExecutionContext.HTTP_REQUEST, req);
|
||||
|
||||
req.setParams(new SimpleParamStack(req.getParams(), params));
|
||||
req.setParams(new DefaultedHttpParams(req.getParams(), params));
|
||||
exec.preProcess(req, proc, ctxt);
|
||||
HttpResponse rsp = exec.execute(req, conn, ctxt);
|
||||
rsp.setParams(new SimpleParamStack(rsp.getParams(), params));
|
||||
rsp.setParams(new DefaultedHttpParams(rsp.getParams(), params));
|
||||
exec.postProcess(rsp, proc, ctxt);
|
||||
|
||||
return rsp;
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.apache.http.client.methods.HttpPost;
|
|||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.localserver.LocalTestServer;
|
||||
import org.apache.http.localserver.ServerTestBase;
|
||||
import org.apache.http.params.SimpleParamStack;
|
||||
import org.apache.http.params.DefaultedHttpParams;
|
||||
import org.apache.http.protocol.ExecutionContext;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
|
@ -88,13 +88,13 @@ public class TestLocalServer extends ServerTestBase {
|
|||
ExecutionContext.HTTP_REQUEST, request);
|
||||
|
||||
request.setParams(
|
||||
new SimpleParamStack(request.getParams(), defaultParams));
|
||||
new DefaultedHttpParams(request.getParams(), defaultParams));
|
||||
httpExecutor.preProcess
|
||||
(request, httpProcessor, httpContext);
|
||||
HttpResponse response = httpExecutor.execute
|
||||
(request, conn, httpContext);
|
||||
response.setParams(
|
||||
new SimpleParamStack(response.getParams(), defaultParams));
|
||||
new DefaultedHttpParams(response.getParams(), defaultParams));
|
||||
httpExecutor.postProcess
|
||||
(response, httpProcessor, httpContext);
|
||||
|
||||
|
@ -133,13 +133,13 @@ public class TestLocalServer extends ServerTestBase {
|
|||
ExecutionContext.HTTP_REQUEST, request);
|
||||
|
||||
request.setParams(
|
||||
new SimpleParamStack(request.getParams(), defaultParams));
|
||||
new DefaultedHttpParams(request.getParams(), defaultParams));
|
||||
httpExecutor.preProcess
|
||||
(request, httpProcessor, httpContext);
|
||||
HttpResponse response = httpExecutor.execute
|
||||
(request, conn, httpContext);
|
||||
response.setParams(
|
||||
new SimpleParamStack(response.getParams(), defaultParams));
|
||||
new DefaultedHttpParams(response.getParams(), defaultParams));
|
||||
httpExecutor.postProcess
|
||||
(response, httpProcessor, httpContext);
|
||||
|
||||
|
|
Loading…
Reference in New Issue