From f67e596013b58f55cfe6c681163299374a7bc738 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Tue, 14 Jan 2014 15:07:14 +0000 Subject: [PATCH] Remove useless parens. git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1558069 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/cache/HttpTestUtils.java | 2 +- .../impl/client/cache/TestProtocolDeviations.java | 4 ++-- .../impl/client/cache/TestProtocolRequirements.java | 12 ++++++------ .../impl/client/cache/TestResponseCachingPolicy.java | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java index 7da22f83d..da16d79a8 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java @@ -252,7 +252,7 @@ public class HttpTestUtils { public static byte[] getRandomBytes(final int nbytes) { final byte[] bytes = new byte[nbytes]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); return bytes; } diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java index b29d62802..a154a6cf9 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java @@ -145,7 +145,7 @@ public class TestProtocolDeviations { private HttpEntity makeBody(final int nbytes) { final byte[] bytes = new byte[nbytes]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); return new ByteArrayEntity(bytes); } @@ -218,7 +218,7 @@ public class TestProtocolDeviations { HTTP_1_1); final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpEntity mockBody = EasyMock.createMockBuilder(ByteArrayEntity.class).withConstructor( new Object[] { bytes }).addMockedMethods("getContentLength").createNiceMock(); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java index 17f527b72..754bc98a8 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java @@ -1782,7 +1782,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { originResponse.setHeader("Content-Range", "bytes 0-50/128"); originResponse.setHeader("Cache-Control", "max-age=3600"); final byte[] bytes = new byte[51]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); originResponse.setEntity(new ByteArrayEntity(bytes)); EasyMock.expect( @@ -2486,7 +2486,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { }; final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes); @@ -2544,7 +2544,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { }; final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes); @@ -2592,7 +2592,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { }; final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes); @@ -2811,7 +2811,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { }; final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, eightSecondsAgo, hdrs, bytes); @@ -2862,7 +2862,7 @@ public class TestProtocolRequirements extends AbstractProtocolTest { }; final byte[] bytes = new byte[128]; - (new Random()).nextBytes(bytes); + new Random().nextBytes(bytes); final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(requestTime, responseTime, hdrs, bytes); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java index e7b0387ee..80401c7b6 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java @@ -667,7 +667,7 @@ public class TestResponseCachingPolicy { } private int getRandomStatus() { - final int rnd = (new Random()).nextInt(acceptableCodes.length); + final int rnd = new Random().nextInt(acceptableCodes.length); return acceptableCodes[rnd]; }