lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r783595 - /lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java
Date Thu, 11 Jun 2009 01:13:52 GMT
Author: markrmiller
Date: Thu Jun 11 01:13:51 2009
New Revision: 783595

URL: http://svn.apache.org/viewvc?rev=783595&view=rev
Log:
LUCENE-1455: close FileInputStream after parsing

Modified:
    lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java

Modified: lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java?rev=783595&r1=783594&r2=783595&view=diff
==============================================================================
--- lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java (original)
+++ lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java Thu Jun
11 01:13:51 2009
@@ -60,8 +60,13 @@
         Tidy tidy = new Tidy();
         tidy.setQuiet(true);
         tidy.setShowWarnings(false);
-        org.w3c.dom.Document root =
-                tidy.parseDOM(new FileInputStream(file), null);
+        org.w3c.dom.Document root = null;
+        InputStream is = new FileInputStream(file);
+        try {
+          root =  tidy.parseDOM(is, null);
+        } finally {
+          is.close();
+        }
         rawDoc = root.getDocumentElement();
     }
 



Mime
View raw message