diff --git a/benchmark-collector/src/it4i/fiji/benchmark_extractor/Extractor.java b/benchmark-collector/src/it4i/fiji/benchmark_extractor/Extractor.java index 414e3737cb531eb1fc7e08eb85b16824232d7614..2354ccec7a66c5a046427ce058ff326c350d9d96 100644 --- a/benchmark-collector/src/it4i/fiji/benchmark_extractor/Extractor.java +++ b/benchmark-collector/src/it4i/fiji/benchmark_extractor/Extractor.java @@ -62,7 +62,7 @@ public class Extractor { } } if(valueCollector != null) { - write(pw, collector, valueCollector);; + write(pw, collector, valueCollector); } } catch (IOException e) { log.log(Level.SEVERE, e.getMessage(), e); diff --git a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/HaaSOutputHolderImpl.java b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/HaaSOutputHolderImpl.java index 80735d2f4578d7073236ec2a04fe0b61e7890ed2..527e1e027d4fa1b258fbf3d8e213d866927333b3 100644 --- a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/HaaSOutputHolderImpl.java +++ b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/HaaSOutputHolderImpl.java @@ -15,10 +15,10 @@ import cz.it4i.fiji.haas_java_client.SynchronizableFileType; public class HaaSOutputHolderImpl implements HaaSOutputHolder { @SuppressWarnings("unused") - private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas.HaaSOutputHolderImpl.class); + private final static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas.HaaSOutputHolderImpl.class); - private Map<SynchronizableFileType, StringBuilder> results = new HashMap<>(); - private HaaSOutputSource source; + private final Map<SynchronizableFileType, StringBuilder> results = new HashMap<>(); + private final HaaSOutputSource source; public HaaSOutputHolderImpl(HaaSOutputSource source) { this.source = source; @@ -38,8 +38,8 @@ public class HaaSOutputHolderImpl implements HaaSOutputHolder { private synchronized void updateData(List<SynchronizableFileType> types) { List<JobSynchronizableFile> files = types.stream().map(type -> new JobSynchronizableFile(type, results.computeIfAbsent(type, x -> new StringBuilder()).length())).collect(Collectors.toList()); - List<String> readed = source.getOutput(files); - Streams.zip(types.stream(), readed.stream(), + List<String> readedContent = source.getOutput(files); + Streams.zip(types.stream(), readedContent.stream(), (type, content) -> (Runnable) (() -> results.get(type).append(content))).forEach(r -> r.run()); } } diff --git a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/JavaFXRoutines.java b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/JavaFXRoutines.java index a14e01392d8b25296155fb66deecf8b144937558..59ae9b7c86a5c374991c1d6f0ffe9e410b62bed0 100644 --- a/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/JavaFXRoutines.java +++ b/haas-imagej-client/src/main/java/cz/it4i/fiji/haas/ui/JavaFXRoutines.java @@ -80,8 +80,7 @@ public interface JavaFXRoutines { } static void initRootAndController(String string, Object parent, boolean setController) { - FXMLLoader fxmlLoader = null; - fxmlLoader = new FXMLLoader(parent.getClass().getResource(string)); + FXMLLoader fxmlLoader = new FXMLLoader(parent.getClass().getResource(string)); fxmlLoader.setControllerFactory(c -> { try { if (c.equals(parent.getClass())) { diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/SPIMComputationAccessorDecoratorWithTimeout.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/SPIMComputationAccessorDecoratorWithTimeout.java index 70c31fd53d3b73822bd56ad8b1295eed739561b9..d308d8a4d015622e98f970d678eb789d2317d205 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/SPIMComputationAccessorDecoratorWithTimeout.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/SPIMComputationAccessorDecoratorWithTimeout.java @@ -13,11 +13,11 @@ import java.util.stream.Collectors; import cz.it4i.fiji.haas_java_client.SynchronizableFileType; public class SPIMComputationAccessorDecoratorWithTimeout implements SPIMComputationAccessor { - private long intervalForQueryInMs; - private P_ResultCacheHolder<List<String>> outputCache; - private P_ResultCacheHolder<Set<String>> changedFilesCache; - private Map<SynchronizableFileType, Integer> allowedTypesIndices = new HashMap<>(); - private List<SynchronizableFileType> allowedTypes = new LinkedList<>(); + private final long intervalForQueryInMs; + private final P_ResultCacheHolder<List<String>> outputCache; + private final P_ResultCacheHolder<Set<String>> changedFilesCache; + private final Map<SynchronizableFileType, Integer> allowedTypesIndices = new HashMap<>(); + private final List<SynchronizableFileType> allowedTypes = new LinkedList<>(); public SPIMComputationAccessorDecoratorWithTimeout(SPIMComputationAccessor decorated, Set<SynchronizableFileType> allowedTypes, long intervalForQueryInMs) { diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/HaaSOutputObservableValueRegistry.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/HaaSOutputObservableValueRegistry.java index 9fdc6fc10740d574da0402356fe1921403caa60a..09a3e1907cdfc5ed9ed3eca19c5d17b2c11a8e3e 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/HaaSOutputObservableValueRegistry.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/HaaSOutputObservableValueRegistry.java @@ -21,19 +21,18 @@ import javafx.beans.value.ObservableValueBase; public class HaaSOutputObservableValueRegistry implements Closeable { @SuppressWarnings("unused") - private static Logger log = LoggerFactory + private final static Logger log = LoggerFactory .getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.HaaSOutputObservableValueRegistry.class); - private Map<SynchronizableFileType, P_HaaSOutputObservableValue> observable = new HashMap<>(); - private List<SynchronizableFileType> types = new LinkedList<>(); - private Timer timer; - private HaaSOutputHolder holder; + private final Map<SynchronizableFileType, P_HaaSOutputObservableValue> observable = new HashMap<>(); + private final List<SynchronizableFileType> types = new LinkedList<>(); + private final Timer timer; + private final HaaSOutputHolder holder; private long timeout; public HaaSOutputObservableValueRegistry(HaaSOutputHolder holder, long timeout) { - super(); this.holder = holder; timer = new Timer(); this.timeout = timeout; diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/JobOutputView.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/JobOutputView.java index 2a6180f60eba6e9f002677cdac1974f7b41f6ab9..a8574a5edd10ddbaf43b3b30223be66c888616ca 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/JobOutputView.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/JobOutputView.java @@ -23,15 +23,18 @@ import cz.it4i.fiji.haas_spim_benchmark.core.BenchmarkJobManager.BenchmarkJob; public class JobOutputView { @SuppressWarnings("unused") - private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.JobOutputView.class); - private Timer timer; + private final static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.JobOutputView.class); + + private final Timer timer; + private final BenchmarkJob job; + private final ExecutorService executor; + private final SynchronizableFileType fileType; + private final Function<BenchmarkJob, String> outputProvider; + private JDialog theDialog; private JTextArea theText; - private BenchmarkJob job; - private ExecutorService executor; - private long readedChars = 0; - private SynchronizableFileType fileType; - private Function<BenchmarkJob, String> outputProvider; + + private long numberOfReadChars = 0; @@ -97,8 +100,8 @@ public class JobOutputView { } else { output = "This is testing line\n"; } - theText.append(output.substring((int) readedChars)); - readedChars = output.length(); + theText.append(output.substring((int) numberOfReadChars)); + numberOfReadChars = output.length(); theText.setCaretPosition(theText.getDocument().getLength()); }); }