Changeset 35321 in osm for applications


Ignore:
Timestamp:
2020-02-15T15:37:16+01:00 (5 years ago)
Author:
donvip
Message:

see #josm18440 - allow IOException to be raised

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/FeatureAdapter.java

    r35320 r35321  
    4242         * @param imageryId imagery id
    4343         * @return the API key for the given imagery id
    44          */
    45         String retrieveApiKey(String imageryId);
     44         * @throws IOException in case of I/O error
     45         */
     46        String retrieveApiKey(String imageryId) throws IOException;
    4647    }
    4748
     
    191192     * @param imageryId imagery id
    192193     * @return the API key for the given imagery id
    193      */
    194     public static String retrieveApiKey(String imageryId) {
     194     * @throws IOException in case of I/O error
     195     */
     196    public static String retrieveApiKey(String imageryId) throws IOException {
    195197        return apiKeyAdapter.retrieveApiKey(imageryId);
    196198    }
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java

    r35320 r35321  
    22package org.openstreetmap.gui.jmapviewer.tilesources;
    33
     4import java.io.IOException;
    45import java.util.HashMap;
    56import java.util.Map;
     
    9394        });
    9495        // Capturing group pattern on API key values
    95         replacePattern(PATTERN_API_KEY, (matcher, output) ->
    96             matcher.appendReplacement(output, FeatureAdapter.retrieveApiKey(imageryId))
    97         );
     96        replacePattern(PATTERN_API_KEY, (matcher, output) -> {
     97            try {
     98                matcher.appendReplacement(output, FeatureAdapter.retrieveApiKey(imageryId));
     99            } catch (IOException e) {
     100                throw new IllegalArgumentException(e);
     101            }
     102        });
    98103        // Capturing group pattern on zoom values
    99104        m = PATTERN_ZOOM.matcher(baseUrl);
Note: See TracChangeset for help on using the changeset viewer.