Hafas: Fix exception message in intToProduct().

This commit is contained in:
Andreas Schildbach 2015-09-19 01:02:41 +02:00
parent 0ae2fe45d0
commit f330f0d799

View file

@ -274,11 +274,12 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
return (1 << productsMap.length) - 1;
}
protected final Product intToProduct(int value)
protected final Product intToProduct(final int productInt)
{
final int allProductsInt = allProductsInt();
checkArgument(value < allProductsInt, "value " + value + " must be smaller than " + allProductsInt);
checkArgument(productInt < allProductsInt, "value " + productInt + " must be smaller than " + allProductsInt);
int value = productInt;
Product product = null;
for (int i = productsMap.length - 1; i >= 0; i--)
{
@ -286,7 +287,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
if (value >= v)
{
if (product != null)
throw new IllegalArgumentException("ambigous value: " + value);
throw new IllegalArgumentException("ambigous value: " + productInt);
product = productsMap[i];
value -= v;
}