ModuleSource newModuleSource = createModuleSource(location, moduleSourceType);
moduleSource = new SharedModuleSource(newModuleSource, this, key);
moduleSources.put(key, moduleSource);
} else {
if (getType(moduleSource.getDelegate()) != moduleSourceType) {
throw new LilyRTException("The same module location was requested earlier but with a different type. Type 1: " + getType(moduleSource) + ", type 2: " + moduleSourceType);
}
}
moduleSource.increaseRefCount();
return moduleSource;
}