log.trace("Trying to load contributions at {}", contribLocation);
try {
mappings = PropertiesLoaderUtils.loadAllProperties(contribLocation, settings.classLoader);
} catch (IOException e) {
throw new ConfigurationPointException("Unable to load Contributions from " + contribLocation, e);
}
Map<String, String> sortedMappings = createTreeMap();
for (Entry<Object, Object> entry : mappings.entrySet()) {
String contribName = trimToNull((String) entry.getKey());
String contribClassName = trimToNull((String) entry.getValue());
if (getDefaultElementName() != null && isEquals(contribName, getDefaultElementName())) {
throw new FatalBeanException(
"Contribution has a same name as the default element name for configuration point: contributionType="
+ contribType + ", contribuitionClass=" + contribClassName + ", contributionName="
+ contribName + ", configurationPoint=" + getName() + ", namespaceUri="
+ getNamespaceUri());
}
sortedMappings.put(contribName, contribClassName);
ContributionImpl contrib = new ContributionImpl(this, settings, contribType, contribName, contribClassName);
Contribution existContrib = contributions.get(contrib.getKey());
if (existContrib != null) {
throw new ConfigurationPointException("Duplicated contributions from locations: " + contribLocation
+ "\n" + " " + existContrib + "\n and " + contrib);
}
register(contrib);