Skip to content

Commit 30e7235

Browse files
committed
nit
1 parent 78f6d9e commit 30e7235

File tree

69 files changed

+793
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+793
-801
lines changed

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

Lines changed: 125 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -139,85 +139,84 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
139139
private final ResponseBodyPartFactory responseBodyPartFactory;
140140
private final int ioThreadsCount;
141141

142-
private DefaultAsyncHttpClientConfig(//
143-
// http
144-
boolean followRedirect,//
145-
int maxRedirects,//
146-
boolean strict302Handling,//
147-
boolean compressionEnforced,//
148-
String userAgent,//
149-
Realm realm,//
150-
int maxRequestRetry,//
151-
boolean disableUrlEncodingForBoundRequests,//
152-
boolean useLaxCookieEncoder,//
153-
boolean disableZeroCopy,//
154-
boolean keepEncodingHeader,//
155-
ProxyServerSelector proxyServerSelector,//
156-
boolean validateResponseHeaders,//
142+
private DefaultAsyncHttpClientConfig(// http
143+
boolean followRedirect,
144+
int maxRedirects,
145+
boolean strict302Handling,
146+
boolean compressionEnforced,
147+
String userAgent,
148+
Realm realm,
149+
int maxRequestRetry,
150+
boolean disableUrlEncodingForBoundRequests,
151+
boolean useLaxCookieEncoder,
152+
boolean disableZeroCopy,
153+
boolean keepEncodingHeader,
154+
ProxyServerSelector proxyServerSelector,
155+
boolean validateResponseHeaders,
157156
boolean aggregateWebSocketFrameFragments,
158157

159158
// timeouts
160-
int connectTimeout,//
161-
int requestTimeout,//
162-
int readTimeout,//
163-
int shutdownQuietPeriod,//
164-
int shutdownTimeout,//
159+
int connectTimeout,
160+
int requestTimeout,
161+
int readTimeout,
162+
int shutdownQuietPeriod,
163+
int shutdownTimeout,
165164

166165
// keep-alive
167-
boolean keepAlive,//
168-
int pooledConnectionIdleTimeout,//
169-
int connectionPoolCleanerPeriod,//
170-
int connectionTtl,//
171-
int maxConnections,//
172-
int maxConnectionsPerHost,//
173-
ChannelPool channelPool,//
174-
KeepAliveStrategy keepAliveStrategy,//
166+
boolean keepAlive,
167+
int pooledConnectionIdleTimeout,
168+
int connectionPoolCleanerPeriod,
169+
int connectionTtl,
170+
int maxConnections,
171+
int maxConnectionsPerHost,
172+
ChannelPool channelPool,
173+
KeepAliveStrategy keepAliveStrategy,
175174

176175
// ssl
177-
boolean useOpenSsl,//
178-
boolean useInsecureTrustManager,//
179-
boolean disableHttpsEndpointIdentificationAlgorithm,//
180-
int handshakeTimeout,//
181-
String[] enabledProtocols,//
182-
String[] enabledCipherSuites,//
183-
int sslSessionCacheSize,//
184-
int sslSessionTimeout,//
185-
SslContext sslContext,//
186-
SslEngineFactory sslEngineFactory,//
176+
boolean useOpenSsl,
177+
boolean useInsecureTrustManager,
178+
boolean disableHttpsEndpointIdentificationAlgorithm,
179+
int handshakeTimeout,
180+
String[] enabledProtocols,
181+
String[] enabledCipherSuites,
182+
int sslSessionCacheSize,
183+
int sslSessionTimeout,
184+
SslContext sslContext,
185+
SslEngineFactory sslEngineFactory,
187186

188187
// filters
189-
List<RequestFilter> requestFilters,//
190-
List<ResponseFilter> responseFilters,//
191-
List<IOExceptionFilter> ioExceptionFilters,//
188+
List<RequestFilter> requestFilters,
189+
List<ResponseFilter> responseFilters,
190+
List<IOExceptionFilter> ioExceptionFilters,
192191

193192
// cookie store
194193
CookieStore cookieStore,
195194

196195
// tuning
197-
boolean tcpNoDelay,//
198-
boolean soReuseAddress,//
199-
int soLinger, //
200-
int soSndBuf, //
201-
int soRcvBuf, //
196+
boolean tcpNoDelay,
197+
boolean soReuseAddress,
198+
int soLinger,
199+
int soSndBuf,
200+
int soRcvBuf,
202201

203202
// internals
204-
String threadPoolName,//
205-
int httpClientCodecMaxInitialLineLength,//
206-
int httpClientCodecMaxHeaderSize,//
207-
int httpClientCodecMaxChunkSize,//
208-
int httpClientCodecInitialBufferSize,//
209-
int chunkedFileChunkSize,//
210-
int webSocketMaxBufferSize,//
211-
int webSocketMaxFrameSize,//
212-
Map<ChannelOption<Object>, Object> channelOptions,//
213-
EventLoopGroup eventLoopGroup,//
214-
boolean useNativeTransport,//
215-
ByteBufAllocator allocator,//
216-
Timer nettyTimer,//
217-
ThreadFactory threadFactory,//
218-
Consumer<Channel> httpAdditionalChannelInitializer,//
219-
Consumer<Channel> wsAdditionalChannelInitializer,//
220-
ResponseBodyPartFactory responseBodyPartFactory,//
203+
String threadPoolName,
204+
int httpClientCodecMaxInitialLineLength,
205+
int httpClientCodecMaxHeaderSize,
206+
int httpClientCodecMaxChunkSize,
207+
int httpClientCodecInitialBufferSize,
208+
int chunkedFileChunkSize,
209+
int webSocketMaxBufferSize,
210+
int webSocketMaxFrameSize,
211+
Map<ChannelOption<Object>, Object> channelOptions,
212+
EventLoopGroup eventLoopGroup,
213+
boolean useNativeTransport,
214+
ByteBufAllocator allocator,
215+
Timer nettyTimer,
216+
ThreadFactory threadFactory,
217+
Consumer<Channel> httpAdditionalChannelInitializer,
218+
Consumer<Channel> wsAdditionalChannelInitializer,
219+
ResponseBodyPartFactory responseBodyPartFactory,
221220
int ioThreadsCount) {
222221

223222
// http
@@ -1170,70 +1169,70 @@ private ProxyServerSelector resolveProxyServerSelector() {
11701169

11711170
public DefaultAsyncHttpClientConfig build() {
11721171

1173-
return new DefaultAsyncHttpClientConfig(//
1174-
followRedirect, //
1175-
maxRedirects, //
1176-
strict302Handling, //
1177-
compressionEnforced, //
1178-
userAgent, //
1179-
realm, //
1180-
maxRequestRetry, //
1181-
disableUrlEncodingForBoundRequests, //
1182-
useLaxCookieEncoder, //
1183-
disableZeroCopy, //
1184-
keepEncodingHeader, //
1185-
resolveProxyServerSelector(), //
1186-
validateResponseHeaders, //
1187-
aggregateWebSocketFrameFragments, //
1188-
connectTimeout, //
1189-
requestTimeout, //
1190-
readTimeout, //
1191-
shutdownQuietPeriod, //
1192-
shutdownTimeout, //
1193-
keepAlive, //
1194-
pooledConnectionIdleTimeout, //
1195-
connectionPoolCleanerPeriod, //
1196-
connectionTtl, //
1197-
maxConnections, //
1198-
maxConnectionsPerHost, //
1199-
channelPool, //
1200-
keepAliveStrategy, //
1201-
useOpenSsl, //
1202-
useInsecureTrustManager, //
1203-
disableHttpsEndpointIdentificationAlgorithm, //
1204-
handshakeTimeout, //
1205-
enabledProtocols, //
1206-
enabledCipherSuites, //
1207-
sslSessionCacheSize, //
1208-
sslSessionTimeout, //
1209-
sslContext, //
1210-
sslEngineFactory, //
1211-
requestFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(requestFilters), //
1212-
responseFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(responseFilters),//
1213-
ioExceptionFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(ioExceptionFilters),//
1172+
return new DefaultAsyncHttpClientConfig(
1173+
followRedirect,
1174+
maxRedirects,
1175+
strict302Handling,
1176+
compressionEnforced,
1177+
userAgent,
1178+
realm,
1179+
maxRequestRetry,
1180+
disableUrlEncodingForBoundRequests,
1181+
useLaxCookieEncoder,
1182+
disableZeroCopy,
1183+
keepEncodingHeader,
1184+
resolveProxyServerSelector(),
1185+
validateResponseHeaders,
1186+
aggregateWebSocketFrameFragments,
1187+
connectTimeout,
1188+
requestTimeout,
1189+
readTimeout,
1190+
shutdownQuietPeriod,
1191+
shutdownTimeout,
1192+
keepAlive,
1193+
pooledConnectionIdleTimeout,
1194+
connectionPoolCleanerPeriod,
1195+
connectionTtl,
1196+
maxConnections,
1197+
maxConnectionsPerHost,
1198+
channelPool,
1199+
keepAliveStrategy,
1200+
useOpenSsl,
1201+
useInsecureTrustManager,
1202+
disableHttpsEndpointIdentificationAlgorithm,
1203+
handshakeTimeout,
1204+
enabledProtocols,
1205+
enabledCipherSuites,
1206+
sslSessionCacheSize,
1207+
sslSessionTimeout,
1208+
sslContext,
1209+
sslEngineFactory,
1210+
requestFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(requestFilters),
1211+
responseFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(responseFilters),
1212+
ioExceptionFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(ioExceptionFilters),
12141213
cookieStore,
1215-
tcpNoDelay, //
1216-
soReuseAddress, //
1217-
soLinger, //
1218-
soSndBuf, //
1219-
soRcvBuf, //
1220-
threadPoolName, //
1221-
httpClientCodecMaxInitialLineLength, //
1222-
httpClientCodecMaxHeaderSize, //
1223-
httpClientCodecMaxChunkSize, //
1224-
httpClientCodecInitialBufferSize, //
1225-
chunkedFileChunkSize, //
1226-
webSocketMaxBufferSize, //
1227-
webSocketMaxFrameSize, //
1228-
channelOptions.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(channelOptions),//
1229-
eventLoopGroup, //
1230-
useNativeTransport, //
1231-
allocator, //
1232-
nettyTimer, //
1233-
threadFactory, //
1234-
httpAdditionalChannelInitializer, //
1235-
wsAdditionalChannelInitializer, //
1236-
responseBodyPartFactory, //
1214+
tcpNoDelay,
1215+
soReuseAddress,
1216+
soLinger,
1217+
soSndBuf,
1218+
soRcvBuf,
1219+
threadPoolName,
1220+
httpClientCodecMaxInitialLineLength,
1221+
httpClientCodecMaxHeaderSize,
1222+
httpClientCodecMaxChunkSize,
1223+
httpClientCodecInitialBufferSize,
1224+
chunkedFileChunkSize,
1225+
webSocketMaxBufferSize,
1226+
webSocketMaxFrameSize,
1227+
channelOptions.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(channelOptions),
1228+
eventLoopGroup,
1229+
useNativeTransport,
1230+
allocator,
1231+
nettyTimer,
1232+
threadFactory,
1233+
httpAdditionalChannelInitializer,
1234+
wsAdditionalChannelInitializer,
1235+
responseBodyPartFactory,
12371236
ioThreadsCount);
12381237
}
12391238
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static Realm.Builder realm(Realm prototype) {
103103
}
104104

105105
public static Realm.Builder realm(AuthScheme scheme, String principal, String password) {
106-
return new Realm.Builder(principal, password)//
106+
return new Realm.Builder(principal, password)
107107
.setScheme(scheme);
108108
}
109109

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

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@ public class Realm {
6161
private final boolean useAbsoluteURI;
6262
private final boolean omitQuery;
6363

64-
private Realm(AuthScheme scheme, //
65-
String principal, //
66-
String password, //
67-
String realmName, //
68-
String nonce, //
69-
String algorithm, //
70-
String response, //
71-
String opaque, //
72-
String qop, //
73-
String nc, //
74-
String cnonce, //
75-
Uri uri, //
76-
boolean usePreemptiveAuth, //
77-
Charset charset, //
78-
String ntlmDomain, //
79-
String ntlmHost, //
80-
boolean useAbsoluteURI, //
64+
private Realm(AuthScheme scheme,
65+
String principal,
66+
String password,
67+
String realmName,
68+
String nonce,
69+
String algorithm,
70+
String response,
71+
String opaque,
72+
String qop,
73+
String nc,
74+
String cnonce,
75+
Uri uri,
76+
boolean usePreemptiveAuth,
77+
Charset charset,
78+
String ntlmDomain,
79+
String ntlmHost,
80+
boolean useAbsoluteURI,
8181
boolean omitQuery) {
8282

8383
this.scheme = assertNotNull(scheme, "scheme");
@@ -333,9 +333,9 @@ private String parseRawQop(String rawQop) {
333333
}
334334

335335
public Builder parseWWWAuthenticateHeader(String headerLine) {
336-
setRealmName(match(headerLine, "realm"))//
337-
.setNonce(match(headerLine, "nonce"))//
338-
.setOpaque(match(headerLine, "opaque"))//
336+
setRealmName(match(headerLine, "realm"))
337+
.setNonce(match(headerLine, "nonce"))
338+
.setOpaque(match(headerLine, "opaque"))
339339
.setScheme(isNonEmpty(nonce) ? AuthScheme.DIGEST : AuthScheme.BASIC);
340340
String algorithm = match(headerLine, "algorithm");
341341
if (isNonEmpty(algorithm)) {
@@ -352,9 +352,9 @@ public Builder parseWWWAuthenticateHeader(String headerLine) {
352352
}
353353

354354
public Builder parseProxyAuthenticateHeader(String headerLine) {
355-
setRealmName(match(headerLine, "realm"))//
356-
.setNonce(match(headerLine, "nonce"))//
357-
.setOpaque(match(headerLine, "opaque"))//
355+
setRealmName(match(headerLine, "realm"))
356+
.setNonce(match(headerLine, "nonce"))
357+
.setOpaque(match(headerLine, "opaque"))
358358
.setScheme(isNonEmpty(nonce) ? AuthScheme.DIGEST : AuthScheme.BASIC);
359359
String algorithm = match(headerLine, "algorithm");
360360
if (isNonEmpty(algorithm)) {
@@ -484,23 +484,23 @@ public Realm build() {
484484
newResponse(md);
485485
}
486486

487-
return new Realm(scheme, //
488-
principal, //
489-
password, //
490-
realmName, //
491-
nonce, //
492-
algorithm, //
493-
response, //
494-
opaque, //
495-
qop, //
496-
nc, //
497-
cnonce, //
498-
uri, //
499-
usePreemptive, //
500-
charset, //
501-
ntlmDomain, //
502-
ntlmHost, //
503-
useAbsoluteURI, //
487+
return new Realm(scheme,
488+
principal,
489+
password,
490+
realmName,
491+
nonce,
492+
algorithm,
493+
response,
494+
opaque,
495+
qop,
496+
nc,
497+
cnonce,
498+
uri,
499+
usePreemptive,
500+
charset,
501+
ntlmDomain,
502+
ntlmHost,
503+
useAbsoluteURI,
504504
omitQuery);
505505
}
506506
}

0 commit comments

Comments
 (0)