mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 08:10:46 +00:00
Clear 'potential null pointer access' warnings.
This commit is contained in:
parent
5f8fc199a4
commit
4c8f48931c
2 changed files with 9 additions and 4 deletions
|
@ -17,6 +17,8 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -2869,6 +2871,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
checkState(departure != null);
|
||||
checkState(arrival != null);
|
||||
|
||||
XmlPullUtil.skipExit(pp, "ps");
|
||||
|
||||
final boolean isRealtime = XmlPullUtil.valueTag(pp, "realtime").equals("1");
|
||||
|
|
|
@ -1201,10 +1201,10 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.skipExit(pp, "Arrival");
|
||||
|
||||
// remove last intermediate
|
||||
final int size = intermediateStops != null ? intermediateStops.size() : 0;
|
||||
if (size >= 1)
|
||||
if (!intermediateStops.get(size - 1).location.id.equals(sectionArrivalLocation.id))
|
||||
intermediateStops.remove(size - 1);
|
||||
if (intermediateStops != null)
|
||||
if (!intermediateStops.isEmpty())
|
||||
if (!intermediateStops.get(intermediateStops.size() - 1).location.id.equals(sectionArrivalLocation.id))
|
||||
intermediateStops.remove(intermediateStops.size() - 1);
|
||||
|
||||
XmlPullUtil.skipExit(pp, "ConSection");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue