Product.fromCode() exception message cosmetics.

This commit is contained in:
Andreas Schildbach 2015-02-08 19:30:32 +01:00
parent 8ce3279390
commit 0ce2677615

View file

@ -37,7 +37,7 @@ public enum Product
this.code = code;
}
public static Product fromCode(char code)
public static Product fromCode(final char code)
{
if (code == HIGH_SPEED_TRAIN.code)
return HIGH_SPEED_TRAIN;
@ -58,6 +58,6 @@ public enum Product
else if (code == ON_DEMAND.code)
return ON_DEMAND;
else
throw new IllegalArgumentException(Character.toString(code));
throw new IllegalArgumentException("unknown code: '" + code + "'");
}
}