incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1564794 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java
Date Wed, 05 Feb 2014 15:00:36 GMT
Author: stefanegli
Date: Wed Feb  5 15:00:35 2014
New Revision: 1564794

URL: http://svn.apache.org/r1564794
Log:
SLING-3375 : patch from Timothee Maret applied, thanks a lot! Plus made method final

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java?rev=1564794&r1=1564793&r2=1564794&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyConnectorClient.java
Wed Feb  5 15:00:35 2014
@@ -127,7 +127,7 @@ public class TopologyConnectorClient imp
     		logger.debug("ping: connectorUrl=" + connectorUrl + ", complete uri=" + uri);
     	}
         HttpClient httpClient = new HttpClient();
-        PutMethod method = new PutMethod(uri);
+        final PutMethod method = new PutMethod(uri);
         try {
             String userInfo = connectorUrl.getUserInfo();
             if (userInfo != null) {
@@ -247,6 +247,8 @@ public class TopologyConnectorClient imp
             logger.warn("ping: got RuntimeException: " + re, re);
             lastInheritedAnnouncement = null;
             statusDetails = "got RuntimeException: "+re;
+        } finally {
+            method.releaseConnection();
         }
     }
 
@@ -325,7 +327,7 @@ public class TopologyConnectorClient imp
         }
 
         HttpClient httpClient = new HttpClient();
-        DeleteMethod method = new DeleteMethod(uri);
+        final DeleteMethod method = new DeleteMethod(uri);
 
         try {
             String userInfo = connectorUrl.getUserInfo();
@@ -350,6 +352,8 @@ public class TopologyConnectorClient imp
             logger.warn("disconnect: got IOException: " + e);
         } catch (RuntimeException re) {
             logger.error("disconnect: got RuntimeException: " + re, re);
+        } finally {
+            method.releaseConnection();
         }
     }
 }



Mime
View raw message