mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 23:28:48 +00:00
AbstractEfaProvider: Provide an IllegalStateException message in processPublicLeg().
This commit is contained in:
parent
1c787b8d1b
commit
918dcc44bb
1 changed files with 6 additions and 4 deletions
|
@ -2588,12 +2588,14 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
|||
// remove first and last, because they are not intermediate
|
||||
final int size = intermediateStops.size();
|
||||
if (size >= 2) {
|
||||
if (!intermediateStops.get(size - 1).location.equals(arrivalLocation))
|
||||
throw new IllegalStateException();
|
||||
final Location lastLocation = intermediateStops.get(size - 1).location;
|
||||
if (!lastLocation.equals(arrivalLocation))
|
||||
throw new IllegalStateException(lastLocation + " vs " + arrivalLocation);
|
||||
intermediateStops.remove(size - 1);
|
||||
|
||||
if (!intermediateStops.get(0).location.equals(departureLocation))
|
||||
throw new IllegalStateException();
|
||||
final Location firstLocation = intermediateStops.get(0).location;
|
||||
if (!firstLocation.equals(departureLocation))
|
||||
throw new IllegalStateException(firstLocation + " vs " + departureLocation);
|
||||
intermediateStops.remove(0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue