Ignore:
Timestamp:
2018-04-19T20:37:16+02:00 (7 years ago)
Author:
Don-vip
Message:

see #16204 - Allow to start and close JOSM in WebStart sandbox mode (where every external access is denied). This was very useful to reproduce some very tricky bugs that occured in real life but were almost impossible to diagnose.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r13559 r13647  
    2525import org.openstreetmap.josm.data.osm.DataSet;
    2626import org.openstreetmap.josm.data.osm.DownloadPolicy;
    27 import org.openstreetmap.josm.data.osm.UploadPolicy;
    2827import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2928import org.openstreetmap.josm.data.osm.Relation;
    3029import org.openstreetmap.josm.data.osm.RelationMember;
     30import org.openstreetmap.josm.data.osm.UploadPolicy;
    3131import org.openstreetmap.josm.data.osm.Way;
    3232import org.openstreetmap.josm.io.IllegalDataException;
     
    6969        if (optimizedWays.isEmpty()) {
    7070            optimizedWays = computeOptimizedBoundaries();
    71             saveOptimizedBoundaries(optimizedWays);
     71            try {
     72                saveOptimizedBoundaries(optimizedWays);
     73            } catch (IOException | SecurityException e) {
     74                Logging.log(Logging.LEVEL_ERROR, "Unable to save optimized boundaries", e);
     75            }
    7276        }
    7377        rlCache = new GeoPropertyIndex<>(new DefaultGeoProperty(optimizedWays), 24);
     
    154158    }
    155159
    156     private static void saveOptimizedBoundaries(Collection<Way> optimizedWays) {
     160    private static void saveOptimizedBoundaries(Collection<Way> optimizedWays) throws IOException {
    157161        DataSet ds = optimizedWays.iterator().next().getDataSet();
    158162        File file = new File(Config.getDirs().getCacheDirectory(true), "left-right-hand-traffic.osm");
     
    163167            w.writeContent(ds);
    164168            w.footer();
    165         } catch (IOException ex) {
    166             throw new JosmRuntimeException(ex);
    167169        }
    168170    }
     
    172174                Config.getDirs().getCacheDirectory(false).getPath(), "left-right-hand-traffic.osm"))) {
    173175           return OsmReader.parseDataSet(is, null).getWays();
    174         } catch (IllegalDataException | IOException | InvalidPathException ex) {
     176        } catch (IllegalDataException | IOException | InvalidPathException | SecurityException ex) {
    175177            Logging.trace(ex);
    176178            return Collections.emptyList();
Note: See TracChangeset for help on using the changeset viewer.