fixed parsing with missing intermediate stops

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@338 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-31 15:02:19 +00:00
parent 40a19dc534
commit cda137a4d4

View file

@ -1078,8 +1078,11 @@ public abstract class AbstractEfaProvider implements NetworkProvider
if (XmlPullUtil.test(pp, "infoLink"))
XmlPullUtil.next(pp);
List<Stop> intermediateStops = null;
if (XmlPullUtil.test(pp, "itdStopSeq"))
{
XmlPullUtil.enter(pp, "itdStopSeq");
final List<Stop> intermediateStops = new LinkedList<Stop>();
intermediateStops = new LinkedList<Stop>();
while (XmlPullUtil.test(pp, "itdPoint"))
{
final int stopId = Integer.parseInt(pp.getAttributeValue(null, "stopID"));
@ -1102,6 +1105,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
throw new IllegalStateException();
intermediateStops.remove(0);
intermediateStops.remove(intermediateStops.size() - 1);
}
parts.add(new Connection.Trip(line, lineColors(line), destinationId, destination, departureTime.getTime(),
departurePosition, departureId, departure, arrivalTime.getTime(), arrivalPosition, arrivalId, arrival,