Fix JOSM #21623: ACE in MapWithAILayerInfo

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head v1.9.3
Taylor Smock 2021-12-02 09:57:52 -07:00
rodzic 52f9d8eae2
commit 0f8072833a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
2 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -319,11 +319,10 @@ public class GetDataRunnable extends RecursiveTask<DataSet> {
* @param replaceTags The tags to replace
*/
public static void replaceTags(DataSet dataSet, Map<Tag, Tag> replaceTags) {
replaceTags
.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().parallelStream()
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|| prim.hasKey(orig.getKey()) && Utils.isBlank(orig.getValue()))
.forEach(prim -> prim.put(replace)));
replaceTags.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().parallelStream()
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|| prim.hasKey(orig.getKey()) && Utils.isBlank(orig.getValue()))
.forEach(prim -> prim.put(replace)));
}
/**

Wyświetl plik

@ -29,6 +29,7 @@ import org.openstreetmap.josm.data.Preferences;
import org.openstreetmap.josm.data.StructUtils;
import org.openstreetmap.josm.data.imagery.ImageryInfo;
import org.openstreetmap.josm.data.preferences.BooleanProperty;
import org.openstreetmap.josm.gui.MainApplication;
import org.openstreetmap.josm.gui.PleaseWaitRunnable;
import org.openstreetmap.josm.io.CachedFile;
import org.openstreetmap.josm.io.NetworkManager;
@ -302,12 +303,14 @@ public class MapWithAILayerInfo {
if (preferences != null) {
// saveOnPut is pretty much always true
preferences.enableSaveOnPut(true);
try {
preferences.save();
} catch (IOException e) {
// This is highly unlikely to happen
Logging.error(e);
}
MainApplication.worker.execute(() -> {
try {
preferences.save();
} catch (IOException e) {
// This is highly unlikely to happen
Logging.error(e);
}
});
}
}
this.finish();