Skip to content

Commit 85f5a9c

Browse files
committed
LUCENE-1455: close FileInputStream after parsing
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@783595 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5b65409 commit 85f5a9c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ public HtmlDocument(File file) throws IOException {
6060
Tidy tidy = new Tidy();
6161
tidy.setQuiet(true);
6262
tidy.setShowWarnings(false);
63-
org.w3c.dom.Document root =
64-
tidy.parseDOM(new FileInputStream(file), null);
63+
org.w3c.dom.Document root = null;
64+
InputStream is = new FileInputStream(file);
65+
try {
66+
root = tidy.parseDOM(is, null);
67+
} finally {
68+
is.close();
69+
}
6570
rawDoc = root.getDocumentElement();
6671
}
6772

0 commit comments

Comments
 (0)