mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 09:39:49 +00:00
Parse empty <ts>
This commit is contained in:
parent
0be5a62a09
commit
115ef114bd
1 changed files with 194 additions and 186 deletions
|
@ -2852,6 +2852,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
final List<Trip> trips = new ArrayList<Trip>();
|
||||
|
||||
if (XmlPullUtil.test(pp, "ts"))
|
||||
{
|
||||
if (!pp.isEmptyElementTag())
|
||||
{
|
||||
XmlPullUtil.enter(pp, "ts");
|
||||
|
||||
|
@ -2913,16 +2915,16 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("departure".equals(usage))
|
||||
{
|
||||
departure = new Stop(location, true, plannedTime.isSet(Calendar.HOUR_OF_DAY) ? plannedTime.getTime()
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null, position,
|
||||
null);
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||
position, null);
|
||||
if (firstDepartureLocation == null)
|
||||
firstDepartureLocation = location;
|
||||
}
|
||||
else if ("arrival".equals(usage))
|
||||
{
|
||||
arrival = new Stop(location, false, plannedTime.isSet(Calendar.HOUR_OF_DAY) ? plannedTime.getTime()
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null, position,
|
||||
null);
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||
position, null);
|
||||
lastArrivalLocation = location;
|
||||
}
|
||||
else
|
||||
|
@ -3000,8 +3002,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
final Stop stop = new Stop(location, false, plannedTime.isSet(Calendar.HOUR_OF_DAY) ? plannedTime.getTime()
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null, null,
|
||||
null);
|
||||
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||
null, null);
|
||||
|
||||
intermediateStops.add(stop);
|
||||
}
|
||||
|
@ -3025,8 +3027,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
if (lineDestination.line == Line.FOOTWAY)
|
||||
{
|
||||
legs.add(new Trip.Individual(Trip.Individual.Type.WALK, departure.location, departure.getDepartureTime(), arrival.location,
|
||||
arrival.getArrivalTime(), path, 0));
|
||||
legs.add(new Trip.Individual(Trip.Individual.Type.WALK, departure.location, departure.getDepartureTime(),
|
||||
arrival.location, arrival.getArrivalTime(), path, 0));
|
||||
}
|
||||
else if (lineDestination.line == Line.SECURE_CONNECTION || lineDestination.line == Line.DO_NOT_CHANGE)
|
||||
{
|
||||
|
@ -3034,7 +3036,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
else
|
||||
{
|
||||
legs.add(new Trip.Public(lineDestination.line, lineDestination.destination, departure, arrival, intermediateStops, path, null));
|
||||
legs.add(new Trip.Public(lineDestination.line, lineDestination.destination, departure, arrival, intermediateStops, path,
|
||||
null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3074,6 +3077,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
XmlPullUtil.exit(pp, "ts");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
}
|
||||
|
||||
if (trips.size() > 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue