Skip to content

Commit

Permalink
NUTCH-3073 Address Java compiler warning
Browse files Browse the repository at this point in the history
- avoid leaking resources
  • Loading branch information
sebastian-nagel committed Oct 4, 2024
1 parent 1db4119 commit 13fcef8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/org/apache/nutch/fetcher/TestFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public void testFetch() throws IOException, ClassNotFoundException, InterruptedE
// verify content
Path content = new Path(new Path(generatedSegment[0], Content.DIR_NAME),
"part-r-00000/data");
@SuppressWarnings("resource")
SequenceFile.Reader reader = new SequenceFile.Reader(conf, SequenceFile.Reader.file(content));

ArrayList<String> handledurls = new ArrayList<String>();
Expand Down Expand Up @@ -171,6 +170,8 @@ public void testFetch() throws IOException, ClassNotFoundException, InterruptedE
}
} while (true);

reader.close();

Collections.sort(handledurls);

Assert.assertEquals(urls.size(), handledurls.size());
Expand Down

0 comments on commit 13fcef8

Please sign in to comment.