Ignore:
Timestamp:
2020-06-19T20:42:36+02:00 (4 years ago)
Author:
simon04
Message:

fix #19299 - Use ConcurrentHashMap for NetworkManager.NETWORK_ERRORS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/NetworkManager.java

    r16426 r16683  
    33
    44import java.net.URL;
     5import java.util.Collections;
    56import java.util.EnumSet;
    6 import java.util.HashMap;
    77import java.util.Map;
    88import java.util.Set;
     9import java.util.concurrent.ConcurrentHashMap;
    910
    1011import org.openstreetmap.josm.tools.Logging;
     
    1617public final class NetworkManager {
    1718
    18     private static final Map<String, Throwable> NETWORK_ERRORS = new HashMap<>();
     19    private static final Map<String, Throwable> NETWORK_ERRORS = new ConcurrentHashMap<>();
    1920
    2021    private static final Set<OnlineResource> OFFLINE_RESOURCES = EnumSet.noneOf(OnlineResource.class);
     
    6364     */
    6465    public static Map<String, Throwable> getNetworkErrors() {
    65         return new HashMap<>(NETWORK_ERRORS);
     66        return Collections.unmodifiableMap(NETWORK_ERRORS);
    6667    }
    6768
Note: See TracChangeset for help on using the changeset viewer.