Initialize transformer field in the constructor
authorVitaliy Bibaev <roenke54@gmail.com>
Wed, 13 Dec 2017 09:03:44 +0000 (12:03 +0300)
committerVitaliy Bibaev <roenke54@gmail.com>
Wed, 13 Dec 2017 09:04:50 +0000 (12:04 +0300)
plugins/stats-collector/src/com/intellij/sorting/MLCompletionSorter.kt

index 799ea7b373d65fb2040526d778197a66cb1e3ffb..0c7d2c5d1dff431cf07c4ad93e63b743bc8f0799 100644 (file)
@@ -37,13 +37,11 @@ interface Ranker {
 }
 
 
-class FeatureTransformerProvider : ApplicationComponent.Adapter() {
+class FeatureTransformerProvider(featureManager: FeatureManager) : ApplicationComponent.Adapter() {
 
-    lateinit var featureTransformer: Transformer
-        private set
+    val featureTransformer: Transformer
 
-    override fun initComponent() {
-        val featureManager = FeatureManager.getInstance()
+    init {
         val factors = featureManager.completionFactors
         val ignored = featureManager.ignoredFactors
         val features = featureManager.allFeatures().associate { it.name to it }