Skip to content

Commit c3288fc

Browse files
author
Stephane Landelle
committed
Raise memory leak message to error
1 parent 586ed3e commit c3288fc

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

api/src/main/java/org/asynchttpclient/AsyncHttpClient.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,26 +214,25 @@ public AsyncHttpClient(AsyncHttpClientConfig config) {
214214

215215
/**
216216
* Create a new HTTP Asynchronous Client using a {@link AsyncHttpClientConfig} configuration and
217-
* and a {@link AsyncHttpProvider}.
217+
* and a AsyncHttpProvider class' name.
218218
*
219-
* @param config a {@link AsyncHttpClientConfig}
220-
* @param httpProvider a {@link AsyncHttpProvider}
219+
* @param config a {@link AsyncHttpClientConfig}
220+
* @param providerClass a {@link AsyncHttpProvider}
221221
*/
222-
public AsyncHttpClient(AsyncHttpProvider httpProvider, AsyncHttpClientConfig config) {
223-
this.config = config;
224-
this.httpProvider = httpProvider;
222+
public AsyncHttpClient(String providerClass, AsyncHttpClientConfig config) {
223+
this(loadProvider(providerClass, config), new AsyncHttpClientConfig.Builder().build());
225224
}
226225

227226
/**
228227
* Create a new HTTP Asynchronous Client using a {@link AsyncHttpClientConfig} configuration and
229-
* and a AsyncHttpProvider class' name.
228+
* and a {@link AsyncHttpProvider}.
230229
*
231-
* @param config a {@link AsyncHttpClientConfig}
232-
* @param providerClass a {@link AsyncHttpProvider}
230+
* @param config a {@link AsyncHttpClientConfig}
231+
* @param httpProvider a {@link AsyncHttpProvider}
233232
*/
234-
public AsyncHttpClient(String providerClass, AsyncHttpClientConfig config) {
235-
this.config = new AsyncHttpClientConfig.Builder().build();
236-
this.httpProvider = loadProvider(providerClass, config);
233+
public AsyncHttpClient(AsyncHttpProvider httpProvider, AsyncHttpClientConfig config) {
234+
this.config = config;
235+
this.httpProvider = httpProvider;
237236
}
238237

239238
public class BoundRequestBuilder extends RequestBuilderBase<BoundRequestBuilder> {
@@ -405,7 +404,7 @@ public void run() {
405404
protected void finalize() throws Throwable {
406405
try {
407406
if (!isClosed.get()) {
408-
logger.debug("AsyncHttpClient.close() hasn't been invoked, which may produce file descriptor leaks");
407+
logger.error("AsyncHttpClient.close() hasn't been invoked, which may produce file descriptor leaks");
409408
}
410409
} finally {
411410
super.finalize();

0 commit comments

Comments
 (0)