ModelRuleDescriptor creator = creators.get(type);
if (creator != null) {
StringBuilder builder = new StringBuilder("Cannot register a factory for type ")
.append(type.getSimpleName())
.append(" because a factory for this type was already registered by ");
creator.describeTo(builder);
builder.append(".");
throw new GradleException(builder.toString());
}
creators.put(type, RuleContext.get());
}