Hi Adrian,

Wouldn't this still leave a stream open? I'm guessing you meant to pass the new stream 'is' in to the readXMLDocument method as the first argument rather than leave the url.openStream() call in there.

Ray


[email protected] wrote:
Author: adrianc
Date: Wed May 20 05:29:52 2009
New Revision: 776563

URL: http://svn.apache.org/viewvc?rev=776563&view=rev
Log:
Closed an InputStream that was left open.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=776563&r1=776562&r2=776563&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java Wed May 20 
05:29:52 2009
@@ -348,9 +348,13 @@
             Debug.logWarning("[UtilXml.readXmlDocument] URL was null, doing 
nothing", module);
             return null;
         }
-        return readXmlDocument(url.openStream(), validate, url.toString());
+        InputStream is = url.openStream();
+        Document document = readXmlDocument(url.openStream(), validate, 
url.toString());
+        is.close();
+        return document;
     }
+
     /**
      * @deprecated
      */



Reply via email to