Changeset 10215 in josm


Ignore:
Timestamp:
2016-05-15T13:44:54+02:00 (4 years ago)
Author:
Don-vip
Message:

findbugs - MS_MUTABLE_COLLECTION

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r10175 r10215  
    55
    66import java.text.NumberFormat;
     7import java.util.Collections;
    78import java.util.LinkedHashMap;
    89import java.util.Locale;
     
    6869    public static final Map<String, SystemOfMeasurement> ALL_SYSTEMS;
    6970    static {
    70         ALL_SYSTEMS = new LinkedHashMap<>();
    71         ALL_SYSTEMS.put(marktr("Metric"), METRIC);
    72         ALL_SYSTEMS.put(marktr("Chinese"), CHINESE);
    73         ALL_SYSTEMS.put(marktr("Imperial"), IMPERIAL);
    74         ALL_SYSTEMS.put(marktr("Nautical Mile"), NAUTICAL_MILE);
     71        Map<String, SystemOfMeasurement> map = new LinkedHashMap<>();
     72        map.put(marktr("Metric"), METRIC);
     73        map.put(marktr("Chinese"), CHINESE);
     74        map.put(marktr("Imperial"), IMPERIAL);
     75        map.put(marktr("Nautical Mile"), NAUTICAL_MILE);
     76        ALL_SYSTEMS = Collections.unmodifiableMap(map);
    7577    }
    7678
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java

    r8795 r10215  
    44import java.util.Arrays;
    55import java.util.Collection;
     6import java.util.Collections;
    67import java.util.List;
    78
     
    8990     * Ordered list of all possible waypoint keys.
    9091     */
    91     List<String> WPT_KEYS = Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT,
     92    List<String> WPT_KEYS = Collections.unmodifiableList(Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT,
    9293            GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, PT_SYM, PT_TYPE,
    93             PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID, META_EXTENSIONS);
     94            PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID, META_EXTENSIONS));
    9495
    9596    /**
    9697     * Ordered list of all possible route and track keys.
    9798     */
    98     List<String> RTE_TRK_KEYS = Arrays.asList(
    99             GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, "number", PT_TYPE, META_EXTENSIONS);
     99    List<String> RTE_TRK_KEYS = Collections.unmodifiableList(Arrays.asList(
     100            GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, "number", PT_TYPE, META_EXTENSIONS));
    100101
    101102    /**
    102103     * Possible fix values.
    103104     */
    104     Collection<String> FIX_VALUES = Arrays.asList("none", "2d", "3d", "dgps", "pps");
     105    Collection<String> FIX_VALUES = Collections.unmodifiableList(Arrays.asList("none", "2d", "3d", "dgps", "pps"));
    105106}
Note: See TracChangeset for help on using the changeset viewer.