1616
1717package org.jacodb.impl
1818
19- import org.jacodb.api.ByteCodeIndexer
20- import org.jacodb.api.ClassSource
21- import org.jacodb.api.JcDatabase
22- import org.jacodb.api.JcFeature
23- import org.jacodb.api.JcSignal
24- import org.jacodb.api.RegisteredLocation
19+ import kotlinx.collections.immutable.toPersistentList
20+ import org.jacodb.api.*
2521import org.jacodb.impl.fs.fullAsmNode
2622import java.io.Closeable
2723
28- class FeaturesRegistry (private val features : List <JcFeature <* , * >>) : Closeable {
24+ class FeaturesRegistry (features : List <JcFeature <* , * >>) : Closeable {
25+
26+ val features = features.toPersistentList()
2927
3028 private lateinit var jcdb: JcDatabase
3129
3230 fun bind (jcdb : JcDatabase ) {
3331 this .jcdb = jcdb
3432 }
3533
36- fun has (feature : JcFeature <* , * >): Boolean {
37- return features.contains(feature)
38- }
39-
4034 fun index (location : RegisteredLocation , classes : List <ClassSource >) {
4135 features.forEach { feature ->
4236 feature.index(location, classes)
@@ -58,10 +52,6 @@ class FeaturesRegistry(private val features: List<JcFeature<*, *>>) : Closeable
5852 features.forEach { it.onSignal(signal.asJcSignal(jcdb)) }
5953 }
6054
61- fun forEach (action : (JcDatabase , JcFeature <* , * >) -> Unit ) {
62- features.forEach { action(jcdb, it) }
63- }
64-
6555 override fun close () {
6656 }
6757
0 commit comments