Commit 6dfdb928 authored by Florian Schäfer's avatar Florian Schäfer

Replace ExecutorService.submit() with Executor.execute() where the returned Future isn't used

parent 0949d401
......@@ -45,7 +45,7 @@ public class FetchWikidataAction extends JosmAction {
if (ds == null) {
return;
}
MainApplication.worker.submit(new Fetcher(ds.getSelected()));
MainApplication.worker.execute(new Fetcher(ds.getSelected()));
}
public static class Fetcher extends PleaseWaitRunnable {
......
......@@ -66,7 +66,7 @@ public class SophoxDownloadReader implements DownloadSource<SophoxDownloadReader
settings.asNewLayer(), data.getDownloadReferrers(), data.getDownloadFull()),
settings.asNewLayer(), area, null);
MainApplication.worker.submit(new PostDownloadHandler(task, future, data.getErrorReporter()));
MainApplication.worker.execute(new PostDownloadHandler(task, future, data.getErrorReporter()));
}
@Override
......
......@@ -12,12 +12,11 @@ import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.stream.Collectors;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import org.openstreetmap.josm.gui.util.GuiHelper;
import org.openstreetmap.josm.tools.Logging;
import org.openstreetmap.josm.tools.Utils;
......@@ -72,8 +71,7 @@ public class WikidataTagCellRenderer extends DefaultTableCellRenderer {
try {
label = labelCache.get(id).get();
} catch (InterruptedException | ExecutionException e) {
Logging.warn("Could not fetch Wikidata label for " + id);
Logging.warn(e);
Logging.log(Level.WARNING, "Could not fetch Wikidata label for " + id, e);
return null;
}
if (label == null) {
......
......@@ -335,7 +335,7 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
selected,
tag.getKey(), tag.getValue());
MainApplication.undoRedo.add(cmd);
MainApplication.worker.submit(new FetchWikidataAction.Fetcher(selected));
MainApplication.worker.execute(new FetchWikidataAction.Fetcher(selected));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment