mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +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>();
|
final List<Trip> trips = new ArrayList<Trip>();
|
||||||
|
|
||||||
if (XmlPullUtil.test(pp, "ts"))
|
if (XmlPullUtil.test(pp, "ts"))
|
||||||
|
{
|
||||||
|
if (!pp.isEmptyElementTag())
|
||||||
{
|
{
|
||||||
XmlPullUtil.enter(pp, "ts");
|
XmlPullUtil.enter(pp, "ts");
|
||||||
|
|
||||||
|
@ -2913,16 +2915,16 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
if ("departure".equals(usage))
|
if ("departure".equals(usage))
|
||||||
{
|
{
|
||||||
departure = new Stop(location, true, plannedTime.isSet(Calendar.HOUR_OF_DAY) ? plannedTime.getTime()
|
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,
|
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||||
null);
|
position, null);
|
||||||
if (firstDepartureLocation == null)
|
if (firstDepartureLocation == null)
|
||||||
firstDepartureLocation = location;
|
firstDepartureLocation = location;
|
||||||
}
|
}
|
||||||
else if ("arrival".equals(usage))
|
else if ("arrival".equals(usage))
|
||||||
{
|
{
|
||||||
arrival = new Stop(location, false, plannedTime.isSet(Calendar.HOUR_OF_DAY) ? plannedTime.getTime()
|
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,
|
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||||
null);
|
position, null);
|
||||||
lastArrivalLocation = location;
|
lastArrivalLocation = location;
|
||||||
}
|
}
|
||||||
else
|
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()
|
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,
|
: predictedTime.getTime(), predictedTime.isSet(Calendar.HOUR_OF_DAY) ? predictedTime.getTime() : null,
|
||||||
null);
|
null, null);
|
||||||
|
|
||||||
intermediateStops.add(stop);
|
intermediateStops.add(stop);
|
||||||
}
|
}
|
||||||
|
@ -3025,8 +3027,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
if (lineDestination.line == Line.FOOTWAY)
|
if (lineDestination.line == Line.FOOTWAY)
|
||||||
{
|
{
|
||||||
legs.add(new Trip.Individual(Trip.Individual.Type.WALK, departure.location, departure.getDepartureTime(), arrival.location,
|
legs.add(new Trip.Individual(Trip.Individual.Type.WALK, departure.location, departure.getDepartureTime(),
|
||||||
arrival.getArrivalTime(), path, 0));
|
arrival.location, arrival.getArrivalTime(), path, 0));
|
||||||
}
|
}
|
||||||
else if (lineDestination.line == Line.SECURE_CONNECTION || lineDestination.line == Line.DO_NOT_CHANGE)
|
else if (lineDestination.line == Line.SECURE_CONNECTION || lineDestination.line == Line.DO_NOT_CHANGE)
|
||||||
{
|
{
|
||||||
|
@ -3034,7 +3036,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
else
|
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");
|
XmlPullUtil.exit(pp, "ts");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XmlPullUtil.next(pp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (trips.size() > 0)
|
if (trips.size() > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue