Changeset 17356 in josm for trunk/src/org


Ignore:
Timestamp:
2020-11-25T10:26:24+01:00 (4 years ago)
Author:
simon04
Message:

see #20152 - GeoJSONReader: better exception for illegal FeatureCollection

File:
1 edited

Legend:

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

    r17185 r17356  
    4545import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    4646import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     47import org.openstreetmap.josm.tools.CheckParameterUtil;
    4748import org.openstreetmap.josm.tools.Logging;
    4849import org.openstreetmap.josm.tools.Utils;
     
    8586                .orElseThrow(() -> new IllegalDataException("No type")).getString()) {
    8687            case "FeatureCollection":
     88                JsonValue.ValueType valueType = object.get(FEATURES).getValueType();
     89                CheckParameterUtil.ensureThat(valueType == JsonValue.ValueType.ARRAY, "features must be ARRAY, but is " + valueType);
    8790                parseFeatureCollection(object.getJsonArray(FEATURES));
    8891                break;
Note: See TracChangeset for help on using the changeset viewer.