Fix JOSM #20555: ACE when removing the plugin

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head
Taylor Smock 2021-05-19 15:52:26 -06:00
rodzic a630f44b50
commit b8e18653d9
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -112,9 +112,12 @@ public final class MapPaintUtils {
* Remove MapWithAI paint styles
*/
public static synchronized void removeMapWithAIPaintStyles() {
new ArrayList<>(MapPaintStyles.getStyles().getStyleSources()).parallelStream().filter(
source -> paintStyleResourceUrl.equals(source.url) || TEST_PATTERN.matcher(source.url).matches())
.forEach(style -> GuiHelper.runInEDT(() -> MapPaintStyles.removeStyle(style)));
// WebStart has issues with streams and EDT permissions. Don't use streams.
for (StyleSource style : new ArrayList<>(MapPaintStyles.getStyles().getStyleSources())) {
if (paintStyleResourceUrl.equals(style.url) || TEST_PATTERN.matcher(style.url).matches()) {
GuiHelper.runInEDT(() -> MapPaintStyles.removeStyle(style));
}
}
}
/**