Rename: allDependentModules --> allDependencyModules

This commit is contained in:
Mikhail Glukhikh
2016-12-12 20:16:19 +03:00
parent 052a5033b5
commit ab72460f28
4 changed files with 12 additions and 11 deletions
@@ -43,9 +43,9 @@ class DefaultImportProvider(
val excludedImports: List<FqName> by storageManager.createLazyValue { val excludedImports: List<FqName> by storageManager.createLazyValue {
val packagesWithAliases = listOf(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME, KotlinBuiltIns.TEXT_PACKAGE_FQ_NAME) val packagesWithAliases = listOf(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME, KotlinBuiltIns.TEXT_PACKAGE_FQ_NAME)
val builtinTypeAliases = moduleDescriptor.allDependentModules val builtinTypeAliases = moduleDescriptor.allDependencyModules
.flatMap { dependentModule -> .flatMap { dependencyModule ->
packagesWithAliases.map(dependentModule::getPackage).flatMap { packagesWithAliases.map(dependencyModule::getPackage).flatMap {
it.memberScope.getContributedDescriptors(DescriptorKindFilter.TYPE_ALIASES).filterIsInstance<TypeAliasDescriptor>() it.memberScope.getContributedDescriptors(DescriptorKindFilter.TYPE_ALIASES).filterIsInstance<TypeAliasDescriptor>()
} }
} }
@@ -45,10 +45,11 @@ interface ModuleDescriptor : DeclarationDescriptor {
fun getSubPackagesOf(fqName: FqName, nameFilter: (Name) -> Boolean): Collection<FqName> fun getSubPackagesOf(fqName: FqName, nameFilter: (Name) -> Boolean): Collection<FqName>
/** /**
* @return dependent modules in the same order in which this module depends on them. Does not include `this` * @return dependency modules in the same order in which this module depends on them. Does not include `this`
*/ */
val allDependentModules: List<ModuleDescriptor> val allDependencyModules: List<ModuleDescriptor>
// All platform-specific modules depending on common 'this' module (result is empty if this is platform-specific itself)
val allImplementingModules: Set<ModuleDescriptor> val allImplementingModules: Set<ModuleDescriptor>
fun <T> getCapability(capability: Capability<T>): T? fun <T> getCapability(capability: Capability<T>): T?
@@ -49,7 +49,7 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
@Deprecated("This method is not going to be supported. Please do not use it") @Deprecated("This method is not going to be supported. Please do not use it")
val testOnly_AllDependentModules: List<ModuleDescriptorImpl> get() = this.dependencies!!.allDependencies val testOnly_AllDependentModules: List<ModuleDescriptorImpl> get() = this.dependencies!!.allDependencies
override val allDependentModules: List<ModuleDescriptor> override val allDependencyModules: List<ModuleDescriptor>
get() = this.dependencies.sure { "Dependencies of module $id were not set" }.allDependencies.filter { it != this } get() = this.dependencies.sure { "Dependencies of module $id were not set" }.allDependencies.filter { it != this }
override val allImplementingModules: MutableSet<ModuleDescriptor> = mutableSetOf() override val allImplementingModules: MutableSet<ModuleDescriptor> = mutableSetOf()
@@ -82,10 +82,10 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
assert(this.dependencies == null) { "Dependencies of $id were already set" } assert(this.dependencies == null) { "Dependencies of $id were already set" }
this.dependencies = dependencies this.dependencies = dependencies
if (platformKind == PlatformKind.DEFAULT) return if (platformKind == PlatformKind.DEFAULT) return
for (dependentModule in allDependentModules) { for (dependencyModule in allDependencyModules) {
if (dependentModule.platformKind != PlatformKind.DEFAULT) continue if (dependencyModule.platformKind != PlatformKind.DEFAULT) continue
if (dependentModule.sourceKind != sourceKind) continue if (dependencyModule.sourceKind != sourceKind) continue
(dependentModule as? ModuleDescriptorImpl)?.allImplementingModules?.add(this) (dependencyModule as? ModuleDescriptorImpl)?.allImplementingModules?.add(this)
} }
} }
@@ -94,7 +94,7 @@ public class ErrorUtils {
@NotNull @NotNull
@Override @Override
public List<ModuleDescriptor> getAllDependentModules() { public List<ModuleDescriptor> getAllDependencyModules() {
return emptyList(); return emptyList();
} }