Skip to content

Commit 34c46bd

Browse files
authored
Merge pull request AsyncHttpClient#1227 from doom369/cleanup
Cleanup IDE warnings
2 parents e3a1764 + 3f3b7c0 commit 34c46bd

File tree

34 files changed

+55
-62
lines changed

34 files changed

+55
-62
lines changed

client/src/main/java/io/netty/util/internal/MacAddressUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static byte[] bestAvailableMac() {
5353
InetAddress bestInetAddr = NetUtil.LOCALHOST4;
5454

5555
// Retrieve the list of available network interfaces.
56-
Map<NetworkInterface, InetAddress> ifaces = new LinkedHashMap<NetworkInterface, InetAddress>();
56+
Map<NetworkInterface, InetAddress> ifaces = new LinkedHashMap<>();
5757
try {
5858
for (Enumeration<NetworkInterface> i = NetworkInterface.getNetworkInterfaces(); i.hasMoreElements();) {
5959
NetworkInterface iface = i.nextElement();

client/src/main/java/org/asynchttpclient/Realm.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class Realm {
6060

6161
public enum AuthScheme {
6262

63-
BASIC, DIGEST, NTLM, SPNEGO, KERBEROS;
63+
BASIC, DIGEST, NTLM, SPNEGO, KERBEROS
6464
}
6565

6666
private Realm(AuthScheme scheme,//
@@ -475,9 +475,9 @@ private void newResponse(MessageDigest md) {
475475

476476
private static String toHexString(byte[] data) {
477477
StringBuilder buffer = StringUtils.stringBuilder();
478-
for (int i = 0; i < data.length; i++) {
479-
buffer.append(Integer.toHexString((data[i] & 0xf0) >>> 4));
480-
buffer.append(Integer.toHexString(data[i] & 0x0f));
478+
for (byte aData : data) {
479+
buffer.append(Integer.toHexString((aData & 0xf0) >>> 4));
480+
buffer.append(Integer.toHexString(aData & 0x0f));
481481
}
482482
return buffer.toString();
483483
}

client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static class Config {
3333
public static final String DEFAULT_AHC_PROPERTIES = "ahc-default.properties";
3434
public static final String CUSTOM_AHC_PROPERTIES = "ahc.properties";
3535

36-
private final ConcurrentHashMap<String, String> propsCache = new ConcurrentHashMap<String, String>();
36+
private final ConcurrentHashMap<String, String> propsCache = new ConcurrentHashMap<>();
3737
private final Properties defaultProperties = parsePropertiesFile(DEFAULT_AHC_PROPERTIES);
3838
private volatile Properties customProperties = parsePropertiesFile(CUSTOM_AHC_PROPERTIES);
3939

@@ -65,9 +65,9 @@ public String getString(String key) {
6565
return propsCache.computeIfAbsent(key, k -> {
6666
String value = System.getProperty(k);
6767
if (value == null)
68-
value = (String) customProperties.getProperty(k);
68+
value = customProperties.getProperty(k);
6969
if (value == null)
70-
value = (String) defaultProperties.getProperty(k);
70+
value = defaultProperties.getProperty(k);
7171
return value;
7272
});
7373
}

client/src/main/java/org/asynchttpclient/cookie/CookieEncoder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public static String encode(Collection<Cookie> cookies) {
6363
} else {
6464
Cookie[] cookiesSorted = cookies.toArray(new Cookie[cookies.size()]);
6565
Arrays.sort(cookiesSorted, COOKIE_COMPARATOR);
66-
for (int i = 0; i < cookiesSorted.length; i++) {
67-
Cookie cookie = cookiesSorted[i];
66+
for (Cookie cookie : cookiesSorted) {
6867
if (cookie != null) {
6968
add(sb, cookie.getName(), cookie.getValue(), cookie.isWrap());
7069
}

client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public DefaultChannelPool(int maxIdleTime,//
7878
PoolLeaseStrategy poolLeaseStrategy,//
7979
Timer nettyTimer,//
8080
int cleanerPeriod) {
81-
this.maxIdleTime = (int) maxIdleTime;
81+
this.maxIdleTime = maxIdleTime;
8282
this.connectionTtl = connectionTtl;
8383
connectionTtlEnabled = connectionTtl > 0;
8484
channelId2Creation = connectionTtlEnabled ? new ConcurrentHashMap<>() : null;
@@ -165,7 +165,7 @@ private List<IdleChannel> expiredChannels(ConcurrentLinkedDeque<IdleChannel> par
165165
return idleTimeoutChannels != null ? idleTimeoutChannels : Collections.<IdleChannel> emptyList();
166166
}
167167

168-
private final List<IdleChannel> closeChannels(List<IdleChannel> candidates) {
168+
private List<IdleChannel> closeChannels(List<IdleChannel> candidates) {
169169

170170
// lazy create, only if we hit a non-closeable channel
171171
List<IdleChannel> closedChannels = null;

client/src/main/java/org/asynchttpclient/netty/handler/WebSocketHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void run() {
168168
} finally {
169169
frame.release();
170170
}
171-
};
171+
}
172172
};
173173
handler.bufferFrame(bufferedFrame);
174174
}

client/src/main/java/org/asynchttpclient/netty/ws/NettyWebSocket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class NettyWebSocket implements WebSocket {
5959
private volatile boolean interestedInTextMessages;
6060

6161
public NettyWebSocket(Channel channel, HttpHeaders upgradeHeaders, AsyncHttpClientConfig config) {
62-
this(channel, upgradeHeaders, config, new ConcurrentLinkedQueue<WebSocketListener>());
62+
this(channel, upgradeHeaders, config, new ConcurrentLinkedQueue<>());
6363
}
6464

6565
public NettyWebSocket(Channel channel, HttpHeaders upgradeHeaders, AsyncHttpClientConfig config, Collection<WebSocketListener> listeners) {

client/src/main/java/org/asynchttpclient/proxy/ProxyServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public Builder setRealm(Realm.Builder realm) {
127127

128128
public Builder setNonProxyHost(String nonProxyHost) {
129129
if (nonProxyHosts == null)
130-
nonProxyHosts = new ArrayList<String>(1);
130+
nonProxyHosts = new ArrayList<>(1);
131131
nonProxyHosts.add(nonProxyHost);
132132
return this;
133133
}

client/src/main/java/org/asynchttpclient/request/body/Body.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum BodyState {
3838
/**
3939
* There's nothing to read and input has to stop
4040
*/
41-
STOP;
41+
STOP
4242
}
4343

4444
/**

client/src/main/java/org/asynchttpclient/request/body/multipart/MultipartUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static MultipartBody newMultipartBody(List<Part> parts, HttpHeaders reque
7373
}
7474

7575
public static List<MultipartPart<? extends Part>> generateMultipartParts(List<Part> parts, byte[] boundary) {
76-
List<MultipartPart<? extends Part>> multipartParts = new ArrayList<MultipartPart<? extends Part>>(parts.size());
76+
List<MultipartPart<? extends Part>> multipartParts = new ArrayList<>(parts.size());
7777
for (Part part : parts) {
7878
if (part instanceof FilePart) {
7979
multipartParts.add(new FileMultipartPart((FilePart) part, boundary));

client/src/main/java/org/asynchttpclient/request/body/multipart/PartBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void setDispositionType(String dispositionType) {
113113

114114
public void addCustomHeader(String name, String value) {
115115
if (customHeaders == null) {
116-
customHeaders = new ArrayList<Param>(2);
116+
customHeaders = new ArrayList<>(2);
117117
}
118118
customHeaders.add(new Param(name, value));
119119
}

client/src/main/java/org/asynchttpclient/request/body/multipart/part/MultipartPart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ protected long transfer(ByteBuf source, WritableByteChannel target, MultipartSta
205205

206206
int transferred = 0;
207207
if (target instanceof GatheringByteChannel) {
208-
transferred = source.readBytes((GatheringByteChannel) target, (int) source.readableBytes());
208+
transferred = source.readBytes((GatheringByteChannel) target, source.readableBytes());
209209
} else {
210210
for (ByteBuffer byteBuffer : source.nioBuffers()) {
211211
int len = byteBuffer.remaining();

client/src/main/java/org/asynchttpclient/request/body/multipart/part/MultipartState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ public enum MultipartState {
2121

2222
POST_CONTENT,
2323

24-
DONE;
24+
DONE
2525
}

client/src/main/java/org/asynchttpclient/spnego/SpnegoEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static SpnegoEngine instance() {
8181
public String generateToken(String server) throws SpnegoEngineException {
8282
GSSContext gssContext = null;
8383
byte[] token = null; // base64 decoded challenge
84-
Oid negotiationOid = null;
84+
Oid negotiationOid;
8585

8686
try {
8787
log.debug("init {}", server);
@@ -152,7 +152,7 @@ public String generateToken(String server) throws SpnegoEngineException {
152152

153153
gssContext.dispose();
154154

155-
String tokenstr = new String(Base64.encode(token));
155+
String tokenstr = Base64.encode(token);
156156
log.debug("Sending response '{}' back to the server", tokenstr);
157157

158158
return tokenstr;

client/src/main/java/org/asynchttpclient/util/HttpUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,31 @@ public class HttpUtils {
3131

3232
public final static Charset DEFAULT_CHARSET = ISO_8859_1;
3333

34-
public static final void validateSupportedScheme(Uri uri) {
34+
public static void validateSupportedScheme(Uri uri) {
3535
final String scheme = uri.getScheme();
3636
if (scheme == null || !scheme.equalsIgnoreCase("http") && !scheme.equalsIgnoreCase("https") && !scheme.equalsIgnoreCase("ws") && !scheme.equalsIgnoreCase("wss")) {
3737
throw new IllegalArgumentException("The URI scheme, of the URI " + uri + ", must be equal (ignoring case) to 'http', 'https', 'ws', or 'wss'");
3838
}
3939
}
4040

41-
public final static String getBaseUrl(Uri uri) {
41+
public static String getBaseUrl(Uri uri) {
4242
// getAuthority duplicate but we don't want to re-concatenate
4343
return uri.getScheme() + "://" + uri.getHost() + ":" + uri.getExplicitPort();
4444
}
4545

46-
public final static String getAuthority(Uri uri) {
46+
public static String getAuthority(Uri uri) {
4747
return uri.getHost() + ":" + uri.getExplicitPort();
4848
}
4949

50-
public final static boolean isSameBase(Uri uri1, Uri uri2) {
50+
public static boolean isSameBase(Uri uri1, Uri uri2) {
5151
return uri1.getScheme().equals(uri2.getScheme()) && uri1.getHost().equals(uri2.getHost()) && uri1.getExplicitPort() == uri2.getExplicitPort();
5252
}
5353

5454
/**
5555
* @param uri the uri
5656
* @return the raw path or "/" if it's null
5757
*/
58-
public final static String getNonEmptyPath(Uri uri) {
58+
public static String getNonEmptyPath(Uri uri) {
5959
return isNonEmpty(uri.getPath()) ? uri.getPath() : "/";
6060
}
6161

@@ -79,7 +79,7 @@ public static Charset parseCharset(String contentType) {
7979
}
8080

8181
public static boolean followRedirect(AsyncHttpClientConfig config, Request request) {
82-
return request.getFollowRedirect() != null ? request.getFollowRedirect().booleanValue() : config.isFollowRedirect();
82+
return request.getFollowRedirect() != null ? request.getFollowRedirect() : config.isFollowRedirect();
8383
}
8484

8585
private static StringBuilder urlEncodeFormParams0(List<Param> params) {

client/src/main/java/org/asynchttpclient/util/ProxyUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public static ProxyServerSelector createProxyServerSelector(Properties propertie
120120

121121
String nonProxyHosts = properties.getProperty(PROXY_NONPROXYHOSTS);
122122
if (nonProxyHosts != null) {
123-
proxyServer.setNonProxyHosts(new ArrayList<String>(Arrays.asList(nonProxyHosts.split("\\|"))));
123+
proxyServer.setNonProxyHosts(new ArrayList<>(Arrays.asList(nonProxyHosts.split("\\|"))));
124124
}
125125

126126
return createProxyServerSelector(proxyServer.build());

client/src/main/java/org/asynchttpclient/util/StringUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class StringUtils {
2121
private static final ThreadLocal<StringBuilder> STRING_BUILDERS = new ThreadLocal<StringBuilder>() {
2222
protected StringBuilder initialValue() {
2323
return new StringBuilder(512);
24-
};
24+
}
2525
};
2626

2727
/**

client/src/main/java/org/asynchttpclient/util/UriEncoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ public static UriEncoder uriEncoder(boolean disableUrlEncoding) {
119119

120120
protected abstract String withoutQueryWithParams(final List<Param> queryParams);
121121

122-
private final String withQuery(final String query, final List<Param> queryParams) {
122+
private String withQuery(final String query, final List<Param> queryParams) {
123123
return isNonEmpty(queryParams) ? withQueryWithParams(query, queryParams) : withQueryWithoutParams(query);
124124
}
125125

126-
private final String withoutQuery(final List<Param> queryParams) {
126+
private String withoutQuery(final List<Param> queryParams) {
127127
return isNonEmpty(queryParams) ? withoutQueryWithParams(queryParams) : null;
128128
}
129129

@@ -140,7 +140,7 @@ public Uri encode(Uri uri, List<Param> queryParams) {
140140

141141
protected abstract String encodePath(String path);
142142

143-
private final String encodeQuery(final String query, final List<Param> queryParams) {
143+
private String encodeQuery(final String query, final List<Param> queryParams) {
144144
return isNonEmpty(query) ? withQuery(query, queryParams) : withoutQuery(queryParams);
145145
}
146146
}

client/src/main/java/org/asynchttpclient/util/Utf8Reader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static String readUtf8(ByteBuf buf, int utflen) throws UTFDataFormatExcep
9191
char3 = b.getByte(readerIndex + count - 1);
9292
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80))
9393
throw new UTFDataFormatException("malformed input around byte " + (count - 1));
94-
chararr[chararr_count++] = (char) (((char1 & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
94+
chararr[chararr_count++] = (char) (((char1 & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F));
9595
break;
9696
default:
9797
/* 10xx xxxx, 1111 xxxx */

client/src/main/java/org/asynchttpclient/util/Utf8UrlEncoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static StringBuilder appendEncoded(StringBuilder sb, CharSequence input,
192192
return sb;
193193
}
194194

195-
private final static void appendSingleByteEncoded(StringBuilder sb, int value, boolean encodeSpaceAsPlus) {
195+
private static void appendSingleByteEncoded(StringBuilder sb, int value, boolean encodeSpaceAsPlus) {
196196

197197
if (value == ' ' && encodeSpaceAsPlus) {
198198
sb.append('+');
@@ -204,7 +204,7 @@ private final static void appendSingleByteEncoded(StringBuilder sb, int value, b
204204
sb.append(HEX[value & 0xF]);
205205
}
206206

207-
private final static void appendMultiByteEncoded(StringBuilder sb, int value) {
207+
private static void appendMultiByteEncoded(StringBuilder sb, int value) {
208208
if (value < 0x800) {
209209
appendSingleByteEncoded(sb, (0xc0 | (value >> 6)), false);
210210
appendSingleByteEncoded(sb, (0x80 | (value & 0x3f)), false);

client/src/main/java/org/asynchttpclient/webdav/WebDavCompletionHandlerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public abstract class WebDavCompletionHandlerBase<T> implements AsyncHandler<T>
4747

4848
private HttpResponseStatus status;
4949
private HttpResponseHeaders headers;
50-
private final List<HttpResponseBodyPart> bodyParts = Collections.synchronizedList(new ArrayList<HttpResponseBodyPart>());
50+
private final List<HttpResponseBodyPart> bodyParts = Collections.synchronizedList(new ArrayList<>());
5151

5252
/**
5353
* {@inheritDoc}

client/src/test/java/org/asynchttpclient/BasicHttpTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public void exceptionInOnCompletedGetNotifiedToOnThrowable() throws Throwable {
560560
withClient().run(client -> {
561561
withServer(server).run(server -> {
562562
final CountDownLatch latch = new CountDownLatch(1);
563-
final AtomicReference<String> message = new AtomicReference<String>();
563+
final AtomicReference<String> message = new AtomicReference<>();
564564

565565
server.enqueueOk();
566566
client.prepareGet(getTargetUrl()).execute(new AsyncCompletionHandlerAdapter() {

client/src/test/java/org/asynchttpclient/ListenableFutureTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ public void testListenableFuture() throws Exception {
3535
try {
3636
statusCode.set(future.get().getStatusCode());
3737
latch.countDown();
38-
} catch (InterruptedException e) {
39-
e.printStackTrace();
40-
} catch (ExecutionException e) {
38+
} catch (InterruptedException | ExecutionException e) {
4139
e.printStackTrace();
4240
}
4341
}, Executors.newFixedThreadPool(1));

client/src/test/java/org/asynchttpclient/channel/MaxConnectionsInThreads.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public void testMaxConnectionsWithinThreads() throws Exception {
6363
final AtomicInteger failedCount = new AtomicInteger();
6464

6565
try (AsyncHttpClient client = asyncHttpClient(config)) {
66-
for (int i = 0; i < urls.length; i++) {
67-
final String url = urls[i];
66+
for (final String url : urls) {
6867
Thread t = new Thread() {
6968
public void run() {
7069
client.prepareGet(url).execute(new AsyncCompletionHandlerBase() {
@@ -93,8 +92,7 @@ public void onThrowable(Throwable t) {
9392

9493
final CountDownLatch notInThreadsLatch = new CountDownLatch(2);
9594
failedCount.set(0);
96-
for (int i = 0; i < urls.length; i++) {
97-
final String url = urls[i];
95+
for (final String url : urls) {
9896
client.prepareGet(url).execute(new AsyncCompletionHandlerBase() {
9997
@Override
10098
public Response onCompleted(Response response) throws Exception {

client/src/test/java/org/asynchttpclient/channel/MaxTotalConnectionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public void testMaxTotalConnectionsExceedingException() throws IOException {
4949

5050
try (AsyncHttpClient client = asyncHttpClient(config)) {
5151
List<ListenableFuture<Response>> futures = new ArrayList<>();
52-
for (int i = 0; i < urls.length; i++) {
53-
futures.add(client.prepareGet(urls[i]).execute());
52+
for (String url : urls) {
53+
futures.add(client.prepareGet(url).execute());
5454
}
5555

5656
boolean caughtError = false;

client/src/test/java/org/asynchttpclient/netty/NettyRequestThrottleTimeoutTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testRequestTimeout() throws IOException {
7979

8080
try (AsyncHttpClient client = asyncHttpClient(config().setMaxConnections(1))) {
8181
final CountDownLatch latch = new CountDownLatch(samples);
82-
final List<Exception> tooManyConnections = Collections.synchronizedList(new ArrayList<Exception>(2));
82+
final List<Exception> tooManyConnections = Collections.synchronizedList(new ArrayList<>(2));
8383

8484
for (int i = 0; i < samples; i++) {
8585
new Thread(new Runnable() {

client/src/test/java/org/asynchttpclient/reactivestreams/ReactiveStreamsDownLoadTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static protected class SimpleStreamedAsyncHandler implements StreamedAsyncHandle
7171
private final SimpleSubscriber<HttpResponseBodyPart> subscriber;
7272

7373
public SimpleStreamedAsyncHandler() {
74-
this(new SimpleSubscriber<HttpResponseBodyPart>());
74+
this(new SimpleSubscriber<>());
7575
}
7676

7777
public SimpleStreamedAsyncHandler(SimpleSubscriber<HttpResponseBodyPart> subscriber) {
@@ -128,7 +128,7 @@ public byte[] getBytes() throws Throwable {
128128
static protected class SimpleSubscriber<T> implements Subscriber<T> {
129129
private volatile Subscription subscription;
130130
private volatile Throwable error;
131-
private final List<T> elements = Collections.synchronizedList(new ArrayList<T>());
131+
private final List<T> elements = Collections.synchronizedList(new ArrayList<>());
132132
private final CountDownLatch latch = new CountDownLatch(1);
133133

134134
@Override

client/src/test/java/org/asynchttpclient/reactivestreams/ReactiveStreamsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static protected class SimpleStreamedAsyncHandler implements StreamedAsyncHandle
122122
private final SimpleSubscriber<HttpResponseBodyPart> subscriber;
123123

124124
public SimpleStreamedAsyncHandler() {
125-
this(new SimpleSubscriber<HttpResponseBodyPart>());
125+
this(new SimpleSubscriber<>());
126126
}
127127

128128
public SimpleStreamedAsyncHandler(SimpleSubscriber<HttpResponseBodyPart> subscriber) {
@@ -176,7 +176,7 @@ public byte[] getBytes() throws Throwable {
176176
static protected class SimpleSubscriber<T> implements Subscriber<T> {
177177
private volatile Subscription subscription;
178178
private volatile Throwable error;
179-
private final List<T> elements = Collections.synchronizedList(new ArrayList<T>());
179+
private final List<T> elements = Collections.synchronizedList(new ArrayList<>());
180180
private final CountDownLatch latch = new CountDownLatch(1);
181181

182182
@Override
@@ -221,7 +221,7 @@ public CancellingStreamedAsyncProvider(int cancelAfter) {
221221

222222
@Override
223223
public State onStream(Publisher<HttpResponseBodyPart> publisher) {
224-
publisher.subscribe(new CancellingSubscriber<HttpResponseBodyPart>(cancelAfter));
224+
publisher.subscribe(new CancellingSubscriber<>(cancelAfter));
225225
return State.CONTINUE;
226226
}
227227

0 commit comments

Comments
 (0)