diff --git a/CHANGELOG.md b/CHANGELOG.md index b0063e5c..14f6ed73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Fixed - MutableMetaImpl attachment and checks +- Listeners in observable meta are replaced by lists ### Security ## [0.5.0] diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/ObservableMeta.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/ObservableMeta.kt index f2b80417..8fa432cc 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/ObservableMeta.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/ObservableMeta.kt @@ -48,7 +48,7 @@ public interface ObservableMutableMeta : ObservableMeta, MutableMeta, MutableTyp } internal abstract class AbstractObservableMeta : ObservableMeta { - private val listeners = ArrayList() + private val listeners: MutableList = mutableListOf() override fun invalidate(name: Name) { listeners.forEach { it.callback(this, name) } diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt index d4f40eb4..2bc0e234 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt @@ -1,6 +1,9 @@ package space.kscience.dataforge.meta -import space.kscience.dataforge.meta.descriptors.* +import space.kscience.dataforge.meta.descriptors.Described +import space.kscience.dataforge.meta.descriptors.MetaDescriptor +import space.kscience.dataforge.meta.descriptors.get +import space.kscience.dataforge.meta.descriptors.validate import space.kscience.dataforge.misc.DFExperimental import space.kscience.dataforge.names.* import space.kscience.dataforge.values.Value @@ -64,7 +67,7 @@ public open class Scheme : Described, MetaRepr, MutableMetaProvider, Configurabl override fun toMeta(): Laminate = Laminate(meta, descriptor?.defaultNode) - private val listeners = HashSet() + private val listeners: MutableList = mutableListOf() private inner class SchemeMeta(val pathName: Name) : ObservableMutableMeta { override var value: Value?