public TranslatorSourceImpl(Map<Class, Translator> configuration, Map<String, Translator> alternates)
{
for (Map.Entry<Class, Translator> me : configuration.entrySet())
{
Class type = me.getKey();
Translator translator = me.getValue();
if (!type.equals(translator.getType()))
throw new RuntimeException(
String
.format(
"Contributed translator for type %s reports its type as %s. Please change the contribution so that the key matches that translator type.",
type.getName(), translator.getType().getName()));
String name = translator.getName();
if (nameToTranslator.containsKey(name))
throw new RuntimeException(
String
.format(