hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1698069 - /httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java
Date Thu, 27 Aug 2015 04:49:56 GMT
Author: ggregory
Date: Thu Aug 27 04:49:56 2015
New Revision: 1698069

URL: http://svn.apache.org/r1698069
Log:
Use try-with-resources.

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java?rev=1698069&r1=1698068&r2=1698069&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncTimeout.java
Thu Aug 27 04:49:56 2015
@@ -125,11 +125,8 @@ public class TestHttpAsyncTimeout extend
                 new BasicAsyncRequestProducer(target, request),
                 new BasicAsyncResponseConsumer(),
                 context, callback);
-        final Socket accepted = serverSocket.accept();
-        try {
+        try (final Socket accepted = serverSocket.accept()) {
             Assert.assertTrue(latch.await(10, TimeUnit.SECONDS));
-        } finally {
-            accepted.close();
         }
     }
 



Mime
View raw message