Collapse identical catch blocks.

This commit is contained in:
Andreas Schildbach 2019-10-16 00:05:52 +02:00
parent f5c475cf0b
commit 12ef4f8039
2 changed files with 6 additions and 18 deletions

View file

@ -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());

View file

@ -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);
}
}