Ignore:
Timestamp:
2014-05-01T02:34:43+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - global use of try-with-resources, according to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java

    r6552 r7033  
    2121            "json,geojson", "json", tr("GeoJSON Files") + " (*.json *.geojson)");
    2222
     23    /**
     24     * Constructs a new {@code GeoJSONExporter}.
     25     */
    2326    public GeoJSONExporter() {
    2427        super(FILE_FILTER);
     
    2932        if (layer instanceof OsmDataLayer) {
    3033            String json = new GeoJSONWriter((OsmDataLayer) layer).write();
    31             Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), Utils.UTF_8));
    32             try {
     34            try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), Utils.UTF_8))) {
    3335                out.write(json);
    34             } finally {
    35                 Utils.close(out);
    3636            }
    3737        } else {
Note: See TracChangeset for help on using the changeset viewer.