Ignore:
Timestamp:
2015-12-15T10:36:12+01:00 (4 years ago)
Author:
bastiK
Message:

see #12186 - simplify method return type

File:
1 edited

Legend:

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

    r9126 r9127  
    142142        nadgrids.put("ntf_r93_b.gsb", NTV2GridShiftFileWrapper.ntf_rgf93);
    143143
     144        List<ProjectionDefinition> pds;
    144145        try {
    145             inits = loadProjectionDefinitions("resource://data/projection/epsg");
     146            pds = loadProjectionDefinitions("resource://data/projection/epsg");
    146147        } catch (IOException ex) {
    147148            throw new RuntimeException(ex);
     149        }
     150        inits = new LinkedHashMap<>();
     151        for (ProjectionDefinition pd : pds) {
     152            inits.put(pd.code, pd);
    148153        }
    149154    }
     
    203208     * @throws java.io.IOException
    204209     */
    205     public static Map<String, ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException {
     210    public static List<ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException {
    206211        try (
    207212            InputStream in = new CachedFile(path).getInputStream();
     
    221226     * @throws java.io.IOException
    222227     */
    223     public static Map<String, ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException {
    224         Map<String, ProjectionDefinition> result = new LinkedHashMap<>();
     228    public static List<ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException {
     229        List<ProjectionDefinition> result = new ArrayList<>();
    225230        Pattern epsgPattern = Pattern.compile("<(\\d+)>(.*)<>");
    226231        String line, lastline = "";
     
    234239                    String code = "EPSG:" + m.group(1);
    235240                    String definition = m.group(2).trim();
    236                     result.put(code, new ProjectionDefinition(code, name, definition));
     241                    result.add(new ProjectionDefinition(code, name, definition));
    237242                } else {
    238243                    Main.warn("Failed to parse line from the EPSG projection definition: "+line);
Note: See TracChangeset for help on using the changeset viewer.