diff --git a/src/de/schildbach/pte/AbstractNavitiaProvider.java b/src/de/schildbach/pte/AbstractNavitiaProvider.java index 692f7900..c92fa9d0 100644 --- a/src/de/schildbach/pte/AbstractNavitiaProvider.java +++ b/src/de/schildbach/pte/AbstractNavitiaProvider.java @@ -415,10 +415,8 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider { } else { return null; } - } catch (final JSONException jsonExc) { + } catch (final JSONException | ParseException jsonExc) { throw new ParserException(jsonExc); - } catch (final ParseException parseExc) { - throw new ParserException(parseExc); } } @@ -471,10 +469,8 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider { return new Stop(location, plannedArrivalTime, plannedArrivalPosition, plannedDepartureTime, plannedDeparturePosition); - } catch (final JSONException jsonExc) { + } catch (final JSONException | ParseException jsonExc) { throw new ParserException(jsonExc); - } catch (final ParseException parseExc) { - throw new ParserException(parseExc); } } @@ -829,10 +825,8 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider { } return result; - } catch (final JSONException jsonExc) { + } catch (final JSONException | ParseException jsonExc) { throw new ParserException(jsonExc); - } catch (final ParseException parseExc) { - throw new ParserException(parseExc); } catch (final NotFoundException fnfExc) { try { final JSONObject head = new JSONObject(fnfExc.getBodyPeek().toString()); diff --git a/src/de/schildbach/pte/VrsProvider.java b/src/de/schildbach/pte/VrsProvider.java index 9b15af1e..d27eb782 100644 --- a/src/de/schildbach/pte/VrsProvider.java +++ b/src/de/schildbach/pte/VrsProvider.java @@ -410,10 +410,8 @@ public class VrsProvider extends AbstractNetworkProvider { } final ResultHeader header = new ResultHeader(NetworkId.VRS, SERVER_PRODUCT, null, null, serverTime, null); return new NearbyLocationsResult(header, locations); - } catch (final JSONException x) { + } catch (final JSONException | ParseException x) { throw new RuntimeException("cannot parse: '" + page + "' on " + url, x); - } catch (final ParseException e) { - throw new RuntimeException("cannot parse: '" + page + "' on " + url, e); } } @@ -510,10 +508,8 @@ public class VrsProvider extends AbstractNetworkProvider { } return result; - } catch (final JSONException x) { + } catch (final JSONException | ParseException x) { throw new RuntimeException("cannot parse: '" + page + "' on " + url, x); - } catch (final ParseException e) { - throw new RuntimeException("cannot parse: '" + page + "' on " + url, e); } } @@ -906,10 +902,8 @@ public class VrsProvider extends AbstractNetworkProvider { context.disableEarlier(); } return new QueryTripsResult(header, url.build().toString(), from, via, to, context, trips); - } catch (final JSONException x) { + } catch (final JSONException | ParseException x) { throw new RuntimeException("cannot parse: '" + page + "' on " + url, x); - } catch (final ParseException e) { - throw new RuntimeException("cannot parse: '" + page + "' on " + url, e); } }