Changeset 15913 in josm for trunk/src/org


Ignore:
Timestamp:
2020-02-23T14:35:55+01:00 (5 years ago)
Author:
simon04
Message:

fix #18754, see #18729 - TaginfoRegionalInstance: fix deadlock

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r15908 r15913  
    372372        if (!newSel.isEmpty()) {
    373373            final LatLon center = newSel.iterator().next().getBBox().getCenter();
    374             Territories.getRegionalTaginfoUrls(center)
     374            Territories.getRegionalTaginfoUrls(center).stream()
    375375                    .map(taginfo -> new TaginfoAction(
    376376                            tagTable, editHelper::getDataKey, editHelper::getDataValues,
  • trunk/src/org/openstreetmap/josm/tools/Territories.java

    r15908 r15913  
    1010import java.util.Collections;
    1111import java.util.HashMap;
     12import java.util.List;
    1213import java.util.Locale;
    1314import java.util.Map;
     
    203204     * @since 15876
    204205     */
    205     public static Stream<TaginfoRegionalInstance> getRegionalTaginfoUrls(LatLon ll) {
     206    public static List<TaginfoRegionalInstance> getRegionalTaginfoUrls(LatLon ll) {
    206207        if (iso3166Cache == null) {
    207             return Stream.empty();
     208            return Collections.emptyList();
    208209        }
    209210        return iso3166Cache.entrySet().parallelStream().distinct()
     
    212213                .distinct()
    213214                .flatMap(code -> Stream.of(taginfoCache, taginfoGeofabrikCache).map(cache -> cache.get(code)))
    214                 .filter(Objects::nonNull);
     215                .filter(Objects::nonNull)
     216                .collect(Collectors.toList());
    215217    }
    216218}
Note: See TracChangeset for help on using the changeset viewer.