Explicit boxing

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1571423 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2014-02-24 20:16:48 +00:00
parent 78198edcbd
commit 4908990207
5 changed files with 10 additions and 8 deletions

View File

@ -219,7 +219,7 @@ class BasicHttpCache implements HttpCache {
error.setHeader("Content-Type","text/plain;charset=UTF-8");
final String msg = String.format("Received incomplete response " +
"with Content-Length %d but actual body length %d",
contentLength, resource.length());
contentLength, Long.valueOf(resource.length()));
final byte[] msgBytes = msg.getBytes();
error.setHeader("Content-Length", Integer.toString(msgBytes.length));
error.setEntity(new ByteArrayEntity(msgBytes));

View File

@ -71,7 +71,7 @@ class BasicIdGenerator {
buffer.append(System.currentTimeMillis());
buffer.append('.');
final Formatter formatter = new Formatter(buffer, Locale.US);
formatter.format("%1$016x-%2$08x", this.count, rndnum);
formatter.format("%1$016x-%2$08x", Long.valueOf(this.count), Integer.valueOf(rndnum));
formatter.close();
buffer.append('.');
buffer.append(this.hostname);

View File

@ -515,12 +515,14 @@ public class CachingExec implements ClientExecChain {
final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
String value;
final Integer major = Integer.valueOf(pv.getMajor());
final Integer minor = Integer.valueOf(pv.getMinor());
if ("http".equalsIgnoreCase(pv.getProtocol())) {
value = String.format("%d.%d localhost (Apache-HttpClient/%s (cache))", pv.getMajor(), pv.getMinor(),
value = String.format("%d.%d localhost (Apache-HttpClient/%s (cache))", major, minor,
release);
} else {
value = String.format("%s/%d.%d localhost (Apache-HttpClient/%s (cache))", pv.getProtocol(), pv.getMajor(),
pv.getMinor(), release);
value = String.format("%s/%d.%d localhost (Apache-HttpClient/%s (cache))", pv.getProtocol(), major,
minor, release);
}
viaHeaders.put(pv, value);

View File

@ -360,10 +360,10 @@ class WarningValue {
@Override
public String toString() {
if (warnDate != null) {
return String.format("%d %s %s \"%s\"", warnCode,
return String.format("%d %s %s \"%s\"", Integer.valueOf(warnCode),
warnAgent, warnText, DateUtils.formatDate(warnDate));
} else {
return String.format("%d %s %s", warnCode, warnAgent, warnText);
return String.format("%d %s %s", Integer.valueOf(warnCode), warnAgent, warnText);
}
}

View File

@ -311,7 +311,7 @@ public class DigestScheme extends RFC2617Scheme {
}
final StringBuilder sb = new StringBuilder(256);
final Formatter formatter = new Formatter(sb, Locale.US);
formatter.format("%08x", nounceCount);
formatter.format("%08x", Long.valueOf(nounceCount));
formatter.close();
final String nc = sb.toString();