cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: [CXF-6632] Fix problem of WSDL's loaded from WSDLManager possibly holding onto themselves strongly and thus resulting in a memory leak.
Date Mon, 12 Oct 2015 19:21:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 315e357e8 -> 88fb9ee70


[CXF-6632] Fix problem of WSDL's loaded from WSDLManager possibly holding onto themselves
strongly and thus resulting in a memory leak.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/88fb9ee7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/88fb9ee7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/88fb9ee7

Branch: refs/heads/master
Commit: 88fb9ee704cea1a3004947d8ce50c6c4882af399
Parents: 315e357
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon Oct 12 15:05:36 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Oct 12 15:05:36 2015 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/88fb9ee7/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
index f04fb05..75e3ff7 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
@@ -195,6 +195,13 @@ public class WSDLManagerImpl implements WSDLManager {
         reader.setFeature("javax.wsdl.verbose", false);
         reader.setFeature("javax.wsdl.importDocuments", true);
         reader.setExtensionRegistry(registry);
+        
+        //we'll create a new String here to make sure the passed in key is not referenced
in the loading of
+        //the wsdl and thus would be held onto from the cached map from both the weak reference
(key) and 
+        //from the strong reference (Definition).  For example, the Definition sometimes
keeps the original
+        //string as the documentBaseLocation which would result in it being held onto strongly

+        //from the definition.  With this, the String the definition holds onto would be
unique 
+        url = new String(url);
         CatalogWSDLLocator catLocator = new CatalogWSDLLocator(url, bus);
         ResourceManagerWSDLLocator wsdlLocator = new ResourceManagerWSDLLocator(url,
                                                                                 catLocator,


Mime
View raw message