mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 08:10:46 +00:00
fixed IndexOutOfBoundsException when no intermediate stops present
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@577 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f06e30063c
commit
3ae140d60f
1 changed files with 11 additions and 6 deletions
|
@ -1611,12 +1611,17 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
XmlPullUtil.exit(pp, "itdStopSeq");
|
XmlPullUtil.exit(pp, "itdStopSeq");
|
||||||
|
|
||||||
// remove first and last, because they are not intermediate
|
// remove first and last, because they are not intermediate
|
||||||
if (intermediateStops.get(0).location.id != departureId)
|
final int size = intermediateStops.size();
|
||||||
throw new IllegalStateException();
|
if (size >= 2)
|
||||||
if (intermediateStops.get(intermediateStops.size() - 1).location.id != arrivalId)
|
{
|
||||||
throw new IllegalStateException();
|
if (intermediateStops.get(size - 1).location.id != arrivalId)
|
||||||
intermediateStops.remove(0);
|
throw new IllegalStateException();
|
||||||
intermediateStops.remove(intermediateStops.size() - 1);
|
intermediateStops.remove(size - 1);
|
||||||
|
|
||||||
|
if (intermediateStops.get(0).location.id != departureId)
|
||||||
|
throw new IllegalStateException();
|
||||||
|
intermediateStops.remove(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Point> path = null;
|
List<Point> path = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue