Sorry, didn't see this thread before committing a fix... it's done in rev 776726.

-David


On May 20, 2009, at 7:05 AM, Adrian Crum wrote:


Oops. You're right. Thanks for pointing that out Ray!

That's what happens when I commit right before going to bed.

-Adrian

--- On Wed, 5/20/09, Ray <[email protected]> wrote:

From: Ray <[email protected]>
Subject: Re: svn commit: r776563 - /ofbiz/trunk/framework/base/src/ org/ofbiz/base/util/UtilXml.java
To: [email protected]
Date: Wednesday, May 20, 2009, 2:29 AM
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