mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 17:10:30 +00:00
fixed NPE
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@841 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
db3510f3d6
commit
71b5cdd6bc
1 changed files with 10 additions and 1 deletions
|
@ -78,7 +78,16 @@ public final class Connection implements Serializable
|
|||
public String toString()
|
||||
{
|
||||
final SimpleDateFormat FORMAT = new SimpleDateFormat("E HH:mm");
|
||||
return id + " " + FORMAT.format(getFirstTripDepartureTime()) + "-" + FORMAT.format(getFirstTripArrivalTime());
|
||||
|
||||
final StringBuilder str = new StringBuilder(id);
|
||||
str.append(' ');
|
||||
final Date firstTripDepartureTime = getFirstTripDepartureTime();
|
||||
str.append(firstTripDepartureTime != null ? FORMAT.format(firstTripDepartureTime) : "null");
|
||||
str.append('-');
|
||||
final Date firstTripArrivalTime = getFirstTripArrivalTime();
|
||||
str.append(firstTripArrivalTime != null ? FORMAT.format(firstTripArrivalTime) : "null");
|
||||
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue