ESRISourceReader: Fix permission issue when run under webstart

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head v1.8.6
Taylor Smock 2021-10-20 06:39:56 -06:00
rodzic 1e5fd0851e
commit 20d58f018a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
2 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -231,11 +231,14 @@ public final class MapWithAIDataUtils {
* @return The {@link ForkJoinPool} for MapWithAI use.
*/
public static ForkJoinPool getForkJoinPool() {
if (Objects.isNull(forkJoinPool) || forkJoinPool.isShutdown()) {
forkJoinPool = Utils.newForkJoinPool(MapWithAIPlugin.NAME.concat(".forkjoinpoolthreads"),
MapWithAIPlugin.NAME, Thread.NORM_PRIORITY);
if (Utils.isRunningWebStart() || System.getSecurityManager() != null) {
if (Objects.isNull(forkJoinPool) || forkJoinPool.isShutdown()) {
forkJoinPool = Utils.newForkJoinPool(MapWithAIPlugin.NAME.concat(".forkjoinpoolthreads"),
MapWithAIPlugin.NAME, Thread.NORM_PRIORITY);
}
return forkJoinPool;
}
return forkJoinPool;
return ForkJoinPool.commonPool();
}
/**

Wyświetl plik

@ -38,6 +38,7 @@ import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
import org.openstreetmap.josm.data.preferences.LongProperty;
import org.openstreetmap.josm.gui.MainApplication;
import org.openstreetmap.josm.io.CachedFile;
import org.openstreetmap.josm.plugins.mapwithai.backend.MapWithAIDataUtils;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAICategory;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIType;
@ -103,7 +104,7 @@ public class ESRISourceReader {
int next = 1;
String searchUrl = startReplace.matcher(search).replaceAll(Integer.toString(next));
final ForkJoinPool forkJoinPool = ForkJoinPool.commonPool();
final ForkJoinPool forkJoinPool = MapWithAIDataUtils.getForkJoinPool();
ArrayList<Future<?>> futureList = new ArrayList<>();
while (next != -1) {
final String finalUrl = url + "content/groups/" + group + searchUrl;