hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1698064 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
Date Thu, 27 Aug 2015 04:41:50 GMT
Author: ggregory
Date: Thu Aug 27 04:41:50 2015
New Revision: 1698064

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

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1698064&r1=1698063&r2=1698064&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
Thu Aug 27 04:41:50 2015
@@ -629,8 +629,7 @@ public class HttpAsyncService implements
         state.setIncoming(null);
 
         final PipelineEntry pipelineEntry;
-        final HttpAsyncRequestConsumer<?> consumer = incoming.getConsumer();
-        try {
+        try (final HttpAsyncRequestConsumer<?> consumer = incoming.getConsumer()) {
             final HttpContext context = incoming.getContext();
             consumer.requestCompleted(context);
             pipelineEntry = new PipelineEntry(
@@ -639,8 +638,6 @@ public class HttpAsyncService implements
                     consumer.getException(),
                     incoming.getHandler(),
                     context);
-        } finally {
-            consumer.close();
         }
         final Queue<PipelineEntry> pipeline = state.getPipeline();
         pipeline.add(pipelineEntry);



Mime
View raw message