- Timestamp:
- 2023-02-09T18:47:09+01:00 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java
r18656 r18658 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException;7 6 import java.io.InputStream; 7 import java.net.SocketException; 8 8 import java.util.Collection; 9 9 import java.util.Map.Entry; … … 18 18 import javax.json.stream.JsonParser; 19 19 import javax.json.stream.JsonParser.Event; 20 import javax.json.stream.JsonParsingException; 20 21 21 22 import org.openstreetmap.josm.data.osm.DataSet; … … 186 187 parse(); 187 188 }); 189 } catch (JsonParsingException exception) { 190 throw new IllegalDataException(exception); 188 191 } catch (JsonException exception) { 189 if (exception.getCause() instanceof IOException) { 190 IllegalDataException ide = new IllegalDataException(exception.getCause()); 191 // PMD 7 should be able to figure out that this is not an issue. See https://github.com/pmd/pmd/issues/2134 . 192 ide.addSuppressed(exception); 193 throw ide; // NOPMD 194 } else { 195 throw exception; 196 } 192 if (exception.getCause() instanceof SocketException) { 193 SocketException soe = (SocketException) exception.getCause(); 194 soe.addSuppressed(exception); // Add the caught exception as a suppressed exception 195 throw new IllegalDataException(soe); // NOPMD -- PreserveStackTrace should be fixed with PMD 7 196 } 197 throw exception; 197 198 } 198 199 }
Note:
See TracChangeset
for help on using the changeset viewer.