kopia lustrzana https://github.com/JOSM/MapWithAI
ESRISourceReader: Fix permission issue when run under webstart
Signed-off-by: Taylor Smock <tsmock@fb.com>pull/1/head v1.8.6
rodzic
1e5fd0851e
commit
20d58f018a
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue