Hafas: Fix handling of lines with unknown product.

This commit is contained in:
Andreas Schildbach 2015-06-16 14:32:50 +02:00
parent d934dfa0d4
commit 9bef580434
7 changed files with 13 additions and 12 deletions

View file

@ -3042,8 +3042,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
}
final Product normalizedType = normalizeType(type);
if (normalizedType == null)
throw new IllegalStateException("cannot normalize type '" + type + "' line '" + normalizedName + "'");
final Line.Attr[] attrs;
if (wheelchairAccess)
@ -3105,9 +3103,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
if (mTram.matches())
return newLine(Product.TRAM, mTram.group(1), null);
}
return newLine(normalizedType, number.replaceAll("\\s+", ""), null);
}
return newLine(normalizedType, number.replaceAll("\\s+", ""), null);
}
throw new IllegalStateException("cannot normalize type '" + type + "' number '" + number + "' line#type '" + lineAndType + "'");