Avoid name hiding
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1571377 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fe360e7b3d
commit
eaaa6fc3ed
|
@ -96,7 +96,7 @@ public class TestCacheValidityPolicy {
|
|||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers);
|
||||
impl = new CacheValidityPolicy() {
|
||||
@Override
|
||||
protected long getApparentAgeSecs(final HttpCacheEntry entry) {
|
||||
protected long getApparentAgeSecs(final HttpCacheEntry ent) {
|
||||
return 6;
|
||||
}
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ public class TestCacheValidityPolicy {
|
|||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers);
|
||||
impl = new CacheValidityPolicy() {
|
||||
@Override
|
||||
protected long getApparentAgeSecs(final HttpCacheEntry entry) {
|
||||
protected long getApparentAgeSecs(final HttpCacheEntry ent) {
|
||||
return 10;
|
||||
}
|
||||
};
|
||||
|
@ -127,12 +127,12 @@ public class TestCacheValidityPolicy {
|
|||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry();
|
||||
impl = new CacheValidityPolicy() {
|
||||
@Override
|
||||
protected long getCorrectedReceivedAgeSecs(final HttpCacheEntry entry) {
|
||||
protected long getCorrectedReceivedAgeSecs(final HttpCacheEntry ent) {
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long getResponseDelaySecs(final HttpCacheEntry entry) {
|
||||
protected long getResponseDelaySecs(final HttpCacheEntry ent) {
|
||||
return 13;
|
||||
}
|
||||
};
|
||||
|
@ -150,11 +150,11 @@ public class TestCacheValidityPolicy {
|
|||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry();
|
||||
impl = new CacheValidityPolicy() {
|
||||
@Override
|
||||
protected long getCorrectedInitialAgeSecs(final HttpCacheEntry entry) {
|
||||
protected long getCorrectedInitialAgeSecs(final HttpCacheEntry ent) {
|
||||
return 11;
|
||||
}
|
||||
@Override
|
||||
protected long getResidentTimeSecs(final HttpCacheEntry entry, final Date d) {
|
||||
protected long getResidentTimeSecs(final HttpCacheEntry ent, final Date d) {
|
||||
return 17;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -164,8 +164,8 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
|
|||
}
|
||||
if (this.poolEntry == null) {
|
||||
final String id = Long.toString(COUNTER.getAndIncrement());
|
||||
final OperatedClientConnection conn = this.connOperator.createConnection();
|
||||
this.poolEntry = new HttpPoolEntry(this.log, id, route, conn, 0, TimeUnit.MILLISECONDS);
|
||||
final OperatedClientConnection opconn = this.connOperator.createConnection();
|
||||
this.poolEntry = new HttpPoolEntry(this.log, id, route, opconn, 0, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
final long now = System.currentTimeMillis();
|
||||
if (this.poolEntry.isExpired(now)) {
|
||||
|
|
|
@ -84,7 +84,7 @@ public class RouteSpecificPool {
|
|||
this.route = route;
|
||||
this.maxEntries = maxEntries;
|
||||
this.connPerRoute = new ConnPerRoute() {
|
||||
public int getMaxForRoute(final HttpRoute route) {
|
||||
public int getMaxForRoute(final HttpRoute unused) {
|
||||
return RouteSpecificPool.this.maxEntries;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -80,10 +80,10 @@ public abstract class HttpRequestBase extends AbstractExecutionAwareRequest
|
|||
public RequestLine getRequestLine() {
|
||||
final String method = getMethod();
|
||||
final ProtocolVersion ver = getProtocolVersion();
|
||||
final URI uri = getURI();
|
||||
final URI uriCopy = getURI(); // avoids possible window where URI could be changed
|
||||
String uritext = null;
|
||||
if (uri != null) {
|
||||
uritext = uri.toASCIIString();
|
||||
if (uriCopy != null) {
|
||||
uritext = uriCopy.toASCIIString();
|
||||
}
|
||||
if (uritext == null || uritext.isEmpty()) {
|
||||
uritext = "/";
|
||||
|
|
|
@ -287,11 +287,11 @@ public class RequestBuilder {
|
|||
public HttpUriRequest build() {
|
||||
final HttpRequestBase result;
|
||||
URI uriNotNull = this.uri != null ? this.uri : URI.create("/");
|
||||
HttpEntity entity = this.entity;
|
||||
HttpEntity entityCopy = this.entity;
|
||||
if (parameters != null && !parameters.isEmpty()) {
|
||||
if (entity == null && (HttpPost.METHOD_NAME.equalsIgnoreCase(method)
|
||||
if (entityCopy == null && (HttpPost.METHOD_NAME.equalsIgnoreCase(method)
|
||||
|| HttpPut.METHOD_NAME.equalsIgnoreCase(method))) {
|
||||
entity = new UrlEncodedFormEntity(parameters, HTTP.DEF_CONTENT_CHARSET);
|
||||
entityCopy = new UrlEncodedFormEntity(parameters, HTTP.DEF_CONTENT_CHARSET);
|
||||
} else {
|
||||
try {
|
||||
uriNotNull = new URIBuilder(uriNotNull).addParameters(parameters).build();
|
||||
|
@ -300,11 +300,11 @@ public class RequestBuilder {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (entity == null) {
|
||||
if (entityCopy == null) {
|
||||
result = new InternalRequest(method);
|
||||
} else {
|
||||
final InternalEntityEclosingRequest request = new InternalEntityEclosingRequest(method);
|
||||
request.setEntity(entity);
|
||||
request.setEntity(entityCopy);
|
||||
result = request;
|
||||
}
|
||||
result.setProtocolVersion(this.version);
|
||||
|
|
Loading…
Reference in New Issue