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
destinationId = 0;
final Line prodLine = parseLineAndType(prod);
final Line line;
if (classStr != null)
{
final char classChar = intToProduct(Integer.parseInt(classStr));
final Matcher m = P_NORMALIZE_LINE.matcher(prod);
final String lineStr;
if (m.matches())
lineStr = classChar + m.group(1) + m.group(2);
else
lineStr = classChar + prod;
line = new Line(null, lineStr, lineStr != null ? lineStyle(lineStr) : null);
if (classChar == 0)
throw new IllegalArgumentException();
// could check for type consistency here
final String lineStr = classChar + prodLine.label.substring(1);
line = new Line(null, lineStr, lineStyle(lineStr));
}
else
{
line = normalizeLine(prod);
line = prodLine;
}
final int[] capacity;