dice-group / IGUANA

IGUANA is a benchmark execution framework for RDF triple stores and quad stores
http://iguana-benchmark.eu
Apache License 2.0
25 stars 15 forks source link

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

Closed nck-mlcnv closed 1 year 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 1 year ago

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

nck-mlcnv commented 1 year ago

close as not planned