Source:
<code>public void testConcurrentWKBFootprintsLoading() throws Exception { WKBLoaderSPI loaderSPI = new WKBLoaderSPI(); FootprintLoader loader = loaderSPI.createLoader(); File newFolder = folder.newFolder(); File footprintFile = TestData.file(this, "footprint_wkbs/r1c1.wkb"); String footprintPath = footprintFile.getAbsolutePath(); String fileName = FilenameUtils.getName(footprintPath); footprintPath = footprintPath.substring(0, footprintPath.length() - 4); Geometry footprint = loader.loadFootprint(footprintPath); int numberOfSamples = 60; String[] testFiles = new String[numberOfSamples]; for (int i = 0; i < numberOfSamples; i++) { String newName = fileName.replace("c1", String.format("c%03d", i)); File ithFile = new File(newFolder, newName); FileUtils.copyFile(footprintFile, ithFile); File ithFootprintFile = new File(newFolder, FilenameUtils.getBaseName(newName)); testFiles[i] = ithFootprintFile.getAbsolutePath(); } ExecutorService service = Executors.newFixedThreadPool(numberOfSamples / 2); CountDownLatch latch = new CountDownLatch(numberOfSamples); List<Geometry> geometries = new ArrayList<>(numberOfSamples); AtomicInteger errors = new AtomicInteger(); try { for (int i = 0; i < numberOfSamples; i++) { int finalI = i; service.submit( () -> { try { geometries.add(loader.loadFootprint(testFiles[finalI])); } catch (InterruptedException e) { } catch (Exception e) { errors.getAndIncrement(); } latch.countDown(); }); } latch.await(); <START> } catch (InterruptedException e) { <END> } finally { folder.delete(); } assertEquals(0, errors.get()); for (Geometry geometry : geometries) { assertEquals(geometry, footprint); } }</code><technical_language>eat exception? A normal execution throw it, I throw instead of silently catchig it</technical_language>

Target:
public void testConcurrentWKBFootprintsLoading() throws Exception { WKBLoaderSPI loaderSPI = new WKBLoaderSPI(); FootprintLoader loader = loaderSPI.createLoader(); File newFolder = folder.newFolder(); File footprintFile = TestData.file(this, "footprint_wkbs/r1c1.wkb"); String footprintPath = footprintFile.getAbsolutePath(); String fileName = FilenameUtils.getName(footprintPath); footprintPath = footprintPath.substring(0, footprintPath.length() - 4); Geometry footprint = loader.loadFootprint(footprintPath); int numberOfSamples = 60; String[] testFiles = new String[numberOfSamples]; for (int i = 0; i < numberOfSamples; i++) { String newName = fileName.replace("c1", String.format("c%03d", i)); File ithFile = new File(newFolder, newName); FileUtils.copyFile(footprintFile, ithFile); File ithFootprintFile = new File(newFolder, FilenameUtils.getBaseName(newName)); testFiles[i] = ithFootprintFile.getAbsolutePath(); } ExecutorService service = Executors.newFixedThreadPool(numberOfSamples / 2); CountDownLatch latch = new CountDownLatch(numberOfSamples); List<Geometry> geometries = new ArrayList<>(numberOfSamples); AtomicInteger errors = new AtomicInteger(); try { for (int i = 0; i < numberOfSamples; i++) { int finalI = i; service.submit( () -> { try { geometries.add(loader.loadFootprint(testFiles[finalI])); } catch (Exception e) { errors.getAndIncrement(); } latch.countDown(); }); } latch.await(); } finally { folder.delete(); } assertEquals(0, errors.get()); for (Geometry geometry : geometries) { assertEquals(geometry, footprint); } }