Minor: reformat ModuleDescriptorImpl.kt
This commit is contained in:
+11
-11
@@ -30,12 +30,12 @@ import org.jetbrains.kotlin.utils.sure
|
|||||||
import java.lang.IllegalArgumentException
|
import java.lang.IllegalArgumentException
|
||||||
|
|
||||||
class ModuleDescriptorImpl @JvmOverloads constructor(
|
class ModuleDescriptorImpl @JvmOverloads constructor(
|
||||||
moduleName: Name,
|
moduleName: Name,
|
||||||
private val storageManager: StorageManager,
|
private val storageManager: StorageManager,
|
||||||
override val builtIns: KotlinBuiltIns,
|
override val builtIns: KotlinBuiltIns,
|
||||||
// May be null in compiler context, should be not-null in IDE context
|
// May be null in compiler context, should be not-null in IDE context
|
||||||
multiTargetPlatform: MultiTargetPlatform? = null,
|
multiTargetPlatform: MultiTargetPlatform? = null,
|
||||||
capabilities: Map<ModuleDescriptor.Capability<*>, Any?> = emptyMap()
|
capabilities: Map<ModuleDescriptor.Capability<*>, Any?> = emptyMap()
|
||||||
) : DeclarationDescriptorImpl(Annotations.EMPTY, moduleName), ModuleDescriptor {
|
) : DeclarationDescriptorImpl(Annotations.EMPTY, moduleName), ModuleDescriptor {
|
||||||
init {
|
init {
|
||||||
if (!moduleName.isSpecial) {
|
if (!moduleName.isSpecial) {
|
||||||
@@ -56,12 +56,13 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val packages = storageManager.createMemoizedFunction<FqName, PackageViewDescriptor> {
|
private val packages = storageManager.createMemoizedFunction<FqName, PackageViewDescriptor> { fqName: FqName ->
|
||||||
fqName: FqName -> LazyPackageViewDescriptorImpl(this, fqName, storageManager)
|
LazyPackageViewDescriptorImpl(this, fqName, storageManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 allDependencyModules: 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 }
|
||||||
@@ -83,8 +84,7 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
|
|||||||
val moduleDependencies = dependencies.sure { "Dependencies of module $id were not set before querying module content" }
|
val moduleDependencies = dependencies.sure { "Dependencies of module $id were not set before querying module content" }
|
||||||
val dependenciesDescriptors = moduleDependencies.allDependencies
|
val dependenciesDescriptors = moduleDependencies.allDependencies
|
||||||
assert(this in dependenciesDescriptors) { "Module $id is not contained in his own dependencies, this is probably a misconfiguration" }
|
assert(this in dependenciesDescriptors) { "Module $id is not contained in his own dependencies, this is probably a misconfiguration" }
|
||||||
dependenciesDescriptors.forEach {
|
dependenciesDescriptors.forEach { dependency ->
|
||||||
dependency ->
|
|
||||||
assert(dependency.isInitialized) {
|
assert(dependency.isInitialized) {
|
||||||
"Dependency module ${dependency.id} was not initialized by the time contents of dependent module ${this.id} were queried"
|
"Dependency module ${dependency.id} was not initialized by the time contents of dependent module ${this.id} were queried"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user