Ignore:
Timestamp:
2015-06-25T01:20:24+02:00 (4 years ago)
Author:
Don-vip
Message:

findbugs

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

Legend:

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

    r8510 r8533  
    103103
    104104        /** Map of all parameters by key */
    105         public static final Map<String, Param> paramsByKey = new HashMap<>();
     105        static final Map<String, Param> paramsByKey = new HashMap<>();
    106106        static {
    107107            for (Param p : Param.values()) {
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r8451 r8533  
    77import java.io.InputStreamReader;
    88import java.nio.charset.StandardCharsets;
     9import java.util.ArrayList;
    910import java.util.Collection;
    1011import java.util.Collections;
    1112import java.util.HashMap;
    1213import java.util.HashSet;
     14import java.util.List;
    1315import java.util.Locale;
    1416import java.util.Map;
     
    3638import org.openstreetmap.josm.io.CachedFile;
    3739import org.openstreetmap.josm.tools.Pair;
     40import org.openstreetmap.josm.tools.Utils;
    3841
    3942/**
     
    6265     * should be compatible to PROJ.4
    6366     */
    64     public static final Map<String, ProjFactory> projs = new HashMap<>();
    65     public static final Map<String, Ellipsoid> ellipsoids = new HashMap<>();
    66     public static final Map<String, Datum> datums = new HashMap<>();
    67     public static final Map<String, NTV2GridShiftFileWrapper> nadgrids = new HashMap<>();
    68     public static final Map<String, Pair<String, String>> inits = new HashMap<>();
     67    static final Map<String, ProjFactory> projs = new HashMap<>();
     68    static final Map<String, Ellipsoid> ellipsoids = new HashMap<>();
     69    static final Map<String, Datum> datums = new HashMap<>();
     70    static final Map<String, NTV2GridShiftFileWrapper> nadgrids = new HashMap<>();
     71    static final Map<String, Pair<String, String>> inits = new HashMap<>();
    6972
    7073    static {
     
    216219        return Collections.unmodifiableCollection(allCodes);
    217220    }
     221
     222    private static String listKeys(Map<String, ?> map) {
     223        List<String> keys = new ArrayList<>(map.keySet());
     224        Collections.sort(keys);
     225        return Utils.join(", ", keys);
     226    }
     227
     228    /**
     229     * Replies the list of projections as string (comma separated).
     230     * @return the list of projections as string (comma separated)
     231     * @since 8533
     232     */
     233    public static String listProjs() {
     234        return listKeys(projs);
     235    }
     236
     237    /**
     238     * Replies the list of ellipsoids as string (comma separated).
     239     * @return the list of ellipsoids as string (comma separated)
     240     * @since 8533
     241     */
     242    public static String listEllipsoids() {
     243        return listKeys(ellipsoids);
     244    }
     245
     246    /**
     247     * Replies the list of datums as string (comma separated).
     248     * @return the list of datums as string (comma separated)
     249     * @since 8533
     250     */
     251    public static String listDatums() {
     252        return listKeys(datums);
     253    }
     254
     255    /**
     256     * Replies the list of nadgrids as string (comma separated).
     257     * @return the list of nadgrids as string (comma separated)
     258     * @since 8533
     259     */
     260    public static String listNadgrids() {
     261        return listKeys(nadgrids);
     262    }
    218263}
Note: See TracChangeset for help on using the changeset viewer.