A small service prepares a batch export of files from a list of paths and returns the result for each input. After the PR change, the behavior started to differ from what is expected: repeated elements behave inconsistently, and an error in one task can change the outcome of the whole operation.
BatchExportService.exportAll(...) method accepts a list of path strings and must return ExportResult.ExportResult.items() response, the order must match the order of the input list.BatchExportService.exportAll(...) with the list:[a.txt, a.txt, fail.txt]
ExportResult.items() with the number of input paths.fail.txt is not lost.ExportResult.items() contains three records in the same order: a.txt, a.txt, fail.txt.fail.txt is available in ExportResult.failure() and does not turn into a successful response.CompletableFuture and ExecutorService from the JDK.javac/java without additional dependenciesExecutorService + CompletableFutureUse line comments to explain the problem, its impact, the fix and how to test it.