xml departures always contain line#type

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@902 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2012-01-26 10:42:26 +00:00
parent 51962ad1bb
commit a70b7a6fe5

View file

@ -626,21 +626,20 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
else else
destinationId = 0; destinationId = 0;
final Line prodLine = parseLineAndType(prod);
final Line line; final Line line;
if (classStr != null) if (classStr != null)
{ {
final char classChar = intToProduct(Integer.parseInt(classStr)); final char classChar = intToProduct(Integer.parseInt(classStr));
final Matcher m = P_NORMALIZE_LINE.matcher(prod); if (classChar == 0)
final String lineStr; throw new IllegalArgumentException();
if (m.matches()) // could check for type consistency here
lineStr = classChar + m.group(1) + m.group(2); final String lineStr = classChar + prodLine.label.substring(1);
else line = new Line(null, lineStr, lineStyle(lineStr));
lineStr = classChar + prod;
line = new Line(null, lineStr, lineStr != null ? lineStyle(lineStr) : null);
} }
else else
{ {
line = normalizeLine(prod); line = prodLine;
} }
final int[] capacity; final int[] capacity;