Changeset 16934 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-08-26T20:24:35+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GeoJSONReader.java
r16933 r16934 67 67 } 68 68 69 private void setParser(final JsonParser parser) { 70 this.parser = parser; 71 } 72 73 private void parse() throws IllegalDataException { 69 private void parse(InputStream inputStream) throws IllegalDataException { 70 try (JsonParser parser = Json.createParser(inputStream)) { 71 parse(parser); 72 } catch (JsonParsingException e) { 73 throw new IllegalDataException(e); 74 } 75 } 76 77 private void parse(final JsonParser parser) throws IllegalDataException { 74 78 while (parser.hasNext()) { 75 79 Event event = parser.next(); … … 390 394 line = line.replaceFirst(rs, ""); 391 395 try (InputStream is = new ByteArrayInputStream(line.getBytes())) { 392 setParser(Json.createParser(is)); 393 parse(); 394 } catch (JsonParsingException e) { 395 throw new IllegalDataException(e); 396 } finally { 397 parser.close(); 396 parse(is); 398 397 } 399 398 } … … 402 401 } 403 402 } else { 404 setParser(Json.createParser(markSupported)); 405 try { 406 parse(); 407 } catch (JsonParsingException e) { 408 throw new IllegalDataException(e); 409 } 403 parse(markSupported); 410 404 } 411 405 return getDataSet();
Note:
See TracChangeset
for help on using the changeset viewer.