mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 00:09:55 +00:00
Hafas: Fix handling of lines with unknown product.
This commit is contained in:
parent
d934dfa0d4
commit
9bef580434
7 changed files with 13 additions and 12 deletions
|
@ -3042,8 +3042,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
final Product normalizedType = normalizeType(type);
|
final Product normalizedType = normalizeType(type);
|
||||||
if (normalizedType == null)
|
|
||||||
throw new IllegalStateException("cannot normalize type '" + type + "' line '" + normalizedName + "'");
|
|
||||||
|
|
||||||
final Line.Attr[] attrs;
|
final Line.Attr[] attrs;
|
||||||
if (wheelchairAccess)
|
if (wheelchairAccess)
|
||||||
|
@ -3105,9 +3103,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
if (mTram.matches())
|
if (mTram.matches())
|
||||||
return newLine(Product.TRAM, mTram.group(1), null);
|
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 + "'");
|
throw new IllegalStateException("cannot normalize type '" + type + "' number '" + number + "' line#type '" + lineAndType + "'");
|
||||||
|
|
|
@ -163,7 +163,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Product normalizeType(String type)
|
protected Product normalizeType(final String type)
|
||||||
{
|
{
|
||||||
final String ucType = type.toUpperCase();
|
final String ucType = type.toUpperCase();
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ public class EireannProvider extends AbstractHafasProvider
|
||||||
if ("CIT".equals(ucType))
|
if ("CIT".equals(ucType))
|
||||||
return Product.BUS;
|
return Product.BUS;
|
||||||
|
|
||||||
return null;
|
// skip parsing of "common" lines
|
||||||
|
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,7 +364,8 @@ public class InvgProvider extends AbstractHafasProvider
|
||||||
if ("1".equals(type))
|
if ("1".equals(type))
|
||||||
return Product.BUS;
|
return Product.BUS;
|
||||||
|
|
||||||
return null;
|
// skip parsing of "common" lines
|
||||||
|
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||||
|
|
|
@ -178,6 +178,7 @@ public class NriProvider extends AbstractHafasProvider
|
||||||
if ("SHI".equals(ucType))
|
if ("SHI".equals(ucType))
|
||||||
return Product.FERRY;
|
return Product.FERRY;
|
||||||
|
|
||||||
return null;
|
// skip parsing of "common" lines
|
||||||
|
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,8 +309,6 @@ public class SeptaProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
final String ucType = type.toUpperCase();
|
final String ucType = type.toUpperCase();
|
||||||
|
|
||||||
// skip parsing of "common" lines, because this is America
|
|
||||||
|
|
||||||
// Regional
|
// Regional
|
||||||
if (ucType.equals("RAI"))
|
if (ucType.equals("RAI"))
|
||||||
return Product.REGIONAL_TRAIN;
|
return Product.REGIONAL_TRAIN;
|
||||||
|
@ -346,6 +344,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
||||||
if (ucType.equals("TROLLEY"))
|
if (ucType.equals("TROLLEY"))
|
||||||
return Product.BUS;
|
return Product.BUS;
|
||||||
|
|
||||||
return null;
|
// skip parsing of "common" lines, because this is America
|
||||||
|
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,8 @@ public class StockholmProvider extends AbstractHafasProvider
|
||||||
if ("FÄRJA".equals(ucType))
|
if ("FÄRJA".equals(ucType))
|
||||||
return Product.FERRY;
|
return Product.FERRY;
|
||||||
|
|
||||||
return null;
|
// skip parsing of "common" lines
|
||||||
|
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue