code cleanup: container module
This commit is contained in:
@@ -18,11 +18,9 @@ package org.jetbrains.kotlin.container
|
||||
|
||||
import java.io.Closeable
|
||||
import java.io.PrintStream
|
||||
import java.io.Writer
|
||||
import java.lang.reflect.ParameterizedType
|
||||
import java.lang.reflect.Type
|
||||
import java.lang.reflect.WildcardType
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class ContainerConsistencyException(message: String) : Exception(message)
|
||||
|
||||
@@ -36,7 +34,7 @@ object DynamicComponentDescriptor : ValueDescriptor {
|
||||
}
|
||||
|
||||
public class StorageComponentContainer(id: String) : ComponentContainer, Closeable {
|
||||
public val unknownContext: ComponentResolveContext by Delegates.lazy { ComponentResolveContext(this, DynamicComponentDescriptor) }
|
||||
public val unknownContext: ComponentResolveContext by lazy { ComponentResolveContext(this, DynamicComponentDescriptor) }
|
||||
val componentStorage = ComponentStorage(id)
|
||||
|
||||
override fun createResolveContext(requestingDescriptor: ValueDescriptor): ValueResolveContext {
|
||||
|
||||
@@ -17,9 +17,8 @@
|
||||
package org.jetbrains.kotlin.container
|
||||
|
||||
import java.io.Closeable
|
||||
import java.lang.reflect.Type
|
||||
import java.util.ArrayList
|
||||
import kotlin.properties.Delegates
|
||||
import java.lang.reflect.*
|
||||
|
||||
enum class ComponentState {
|
||||
Null,
|
||||
@@ -33,7 +32,7 @@ enum class ComponentState {
|
||||
public abstract class SingletonDescriptor(val container: ComponentContainer) : ComponentDescriptor, Closeable {
|
||||
private var instance: Any? = null
|
||||
protected var state: ComponentState = ComponentState.Null
|
||||
private val disposableObjects by Delegates.lazy { ArrayList<Closeable>() }
|
||||
private val disposableObjects by lazy { ArrayList<Closeable>() }
|
||||
|
||||
public override fun getValue(): Any {
|
||||
when {
|
||||
|
||||
Reference in New Issue
Block a user