mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 15:35:20 +00:00
Remove useless parens.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1558069 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fe84b2934c
commit
f67e596013
@ -252,7 +252,7 @@ public static boolean equivalent(final HttpResponse r1, final HttpResponse r2) {
|
|||||||
|
|
||||||
public static byte[] getRandomBytes(final int nbytes) {
|
public static byte[] getRandomBytes(final int nbytes) {
|
||||||
final byte[] bytes = new byte[nbytes];
|
final byte[] bytes = new byte[nbytes];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ private void verifyMocks() {
|
|||||||
|
|
||||||
private HttpEntity makeBody(final int nbytes) {
|
private HttpEntity makeBody(final int nbytes) {
|
||||||
final byte[] bytes = new byte[nbytes];
|
final byte[] bytes = new byte[nbytes];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
return new ByteArrayEntity(bytes);
|
return new ByteArrayEntity(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ public void testHTTP1_1RequestsWithUnknownBodyLengthAreRejectedOrHaveContentLeng
|
|||||||
HTTP_1_1);
|
HTTP_1_1);
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpEntity mockBody = EasyMock.createMockBuilder(ByteArrayEntity.class).withConstructor(
|
final HttpEntity mockBody = EasyMock.createMockBuilder(ByteArrayEntity.class).withConstructor(
|
||||||
new Object[] { bytes }).addMockedMethods("getContentLength").createNiceMock();
|
new Object[] { bytes }).addMockedMethods("getContentLength").createNiceMock();
|
||||||
|
@ -1782,7 +1782,7 @@ public void test206ResponsesAreNotCachedIfTheCacheDoesNotSupportRangeAndContentR
|
|||||||
originResponse.setHeader("Content-Range", "bytes 0-50/128");
|
originResponse.setHeader("Content-Range", "bytes 0-50/128");
|
||||||
originResponse.setHeader("Cache-Control", "max-age=3600");
|
originResponse.setHeader("Cache-Control", "max-age=3600");
|
||||||
final byte[] bytes = new byte[51];
|
final byte[] bytes = new byte[51];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
originResponse.setEntity(new ByteArrayEntity(bytes));
|
originResponse.setEntity(new ByteArrayEntity(bytes));
|
||||||
|
|
||||||
EasyMock.expect(
|
EasyMock.expect(
|
||||||
@ -2486,7 +2486,7 @@ public void testMustReturnACacheEntryIfItCanRevalidateIt() throws Exception {
|
|||||||
};
|
};
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
||||||
|
|
||||||
@ -2544,7 +2544,7 @@ public void testMustReturnAFreshEnoughCacheEntryIfItHasIt() throws Exception {
|
|||||||
};
|
};
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
||||||
|
|
||||||
@ -2592,7 +2592,7 @@ public void testMustServeAppropriateErrorOrWarningIfNoOriginCommunicationPossibl
|
|||||||
};
|
};
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
||||||
|
|
||||||
@ -2811,7 +2811,7 @@ public void testAgeHeaderPopulatedFromCacheEntryCurrentAge() throws Exception {
|
|||||||
};
|
};
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes);
|
||||||
|
|
||||||
@ -2862,7 +2862,7 @@ public void testHeuristicCacheOlderThan24HoursHasWarningAttached() throws Except
|
|||||||
};
|
};
|
||||||
|
|
||||||
final byte[] bytes = new byte[128];
|
final byte[] bytes = new byte[128];
|
||||||
(new Random()).nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
||||||
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(requestTime, responseTime, hdrs, bytes);
|
final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(requestTime, responseTime, hdrs, bytes);
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ public void otherStatusCodesAreCacheableWithExplicitCachingHeaders() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getRandomStatus() {
|
private int getRandomStatus() {
|
||||||
final int rnd = (new Random()).nextInt(acceptableCodes.length);
|
final int rnd = new Random().nextInt(acceptableCodes.length);
|
||||||
|
|
||||||
return acceptableCodes[rnd];
|
return acceptableCodes[rnd];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user