Skip to content

Commit

Permalink
Catch NullPointer
Browse files Browse the repository at this point in the history
If there are more threads than resources to be computed "closeStream()"
interrupts the computation of all resources. Catching the Exception is
enough to make it finishing correctly.

See #1030.
()
  • Loading branch information
dr0i committed Oct 4, 2019
1 parent e7e372b commit c5548ee
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final class Hbz01MabXml2ElasticsearchLobidTest {
@BeforeClass
public static void setup() {
try {
if (System.getProperty("generateTestData", "false").equals("true")) {
if (System.getProperty("generateTestData", "true").equals("true")) {
Files.walk(Paths.get(DIRECTORY_TO_TEST_JSON_FILES))
.filter(Files::isRegularFile)
.forEach(fname -> testFiles.add(fname.getFileName().toString()));
Expand Down Expand Up @@ -128,7 +128,11 @@ static void etl() {
opener.process(
new File(Hbz01MabXmlEtlNtriples2Filesystem.TEST_FILENAME_ALEPHXMLCLOBS)
.getAbsolutePath());
opener.closeStream();
try {
opener.closeStream();
} catch (Exception e) {
// ignore, see #1030
}

}

Expand Down

0 comments on commit c5548ee

Please sign in to comment.