mirror of https://github.com/apache/lucene.git
LUCENE-1455: close FileInputStream after parsing
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@783595 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5b654095c6
commit
85f5a9c740
|
@ -60,8 +60,13 @@ public class HtmlDocument {
|
||||||
Tidy tidy = new Tidy();
|
Tidy tidy = new Tidy();
|
||||||
tidy.setQuiet(true);
|
tidy.setQuiet(true);
|
||||||
tidy.setShowWarnings(false);
|
tidy.setShowWarnings(false);
|
||||||
org.w3c.dom.Document root =
|
org.w3c.dom.Document root = null;
|
||||||
tidy.parseDOM(new FileInputStream(file), null);
|
InputStream is = new FileInputStream(file);
|
||||||
|
try {
|
||||||
|
root = tidy.parseDOM(is, null);
|
||||||
|
} finally {
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
rawDoc = root.getDocumentElement();
|
rawDoc = root.getDocumentElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue