dice-group / IGUANA

IGUANA is a benchmark execution framework for RDF triple stores and quad stores
http://iguana-benchmark.eu
GNU Affero General Public License v3.0
24 stars 15 forks source link

Correct the try-with-resource-block in the CLIWorker #204

Closed nck-mlcnv closed 10 months ago

nck-mlcnv commented 1 year ago

Change the line: https://github.com/dice-group/IGUANA/blob/efd02d5d4506a20428698c2831dd30af0543a427/iguana.corecontroller/src/main/java/org/aksw/iguana/cc/worker/impl/CLIWorker.java#L54

to something like this:

try (InputStreamReader isr = new InputStreamReader(process.getInputStream());
     BufferedReader br = new BufferedReader(isr)) {
ELBuenFercho commented 1 year ago

The original line of code should work correctly, are you just trying to make it more readable?

nck-mlcnv commented 1 year ago

It does work fine normally, but if the constructor of the BufferedReader throws an exception, the InputStream won't be closed. See: https://stackoverflow.com/a/1388772

nck-mlcnv commented 10 months ago

The CLI-Worker will be removed with the new upcoming release

nck-mlcnv commented 10 months ago

close as not planned