Skip to content

Commit e897808

Browse files
Vladimir Kotalahornace
authored andcommitted
try with resources
1 parent 2c632b9 commit e897808

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/MercurialHistoryParserRevisionsOnly.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ void parse(File file, String sinceRevision) throws HistoryException {
5959

6060
@Override
6161
public void processStream(InputStream input) throws IOException {
62-
BufferedReader in = new BufferedReader(new InputStreamReader(input));
63-
String s;
64-
while ((s = in.readLine()) != null) {
65-
visitor.accept(s);
62+
try (BufferedReader in = new BufferedReader(new InputStreamReader(input))) {
63+
String s;
64+
while ((s = in.readLine()) != null) {
65+
visitor.accept(s);
66+
}
6667
}
6768
}
6869
}

0 commit comments

Comments
 (0)