From 6fa7da57a4e8afd984550ea8e1c76468ea26617e Mon Sep 17 00:00:00 2001 From: Anton Yalyshev Date: Thu, 19 Sep 2019 12:41:57 +0300 Subject: [PATCH] It's better to get plugin version once but not in cycle --- .../kotlin/idea/statistics/ProjectConfigurationCollector.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/statistics/ProjectConfigurationCollector.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/statistics/ProjectConfigurationCollector.kt index 46cc685bb33..bca18f41a49 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/statistics/ProjectConfigurationCollector.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/statistics/ProjectConfigurationCollector.kt @@ -26,12 +26,14 @@ class ProjectConfigurationCollector : ProjectUsagesCollector() { override fun getUsages(project: Project): Set { val usages = mutableSetOf() val modulesWithFacet = ProjectFacetManager.getInstance(project).getModulesWithFacet(KotlinFacetType.TYPE_ID) + if (modulesWithFacet.isNotEmpty()) { + val pluginVersion = KotlinPluginUtil.getPluginVersion() modulesWithFacet.forEach { val buildSystem = getBuildSystemType(it) val platform = getPlatform(it) val data = FeatureUsageData() - .addData("pluginVersion", KotlinPluginUtil.getPluginVersion()) + .addData("pluginVersion", pluginVersion) .addData("system", buildSystem) .addData("platform", platform) val usageDescriptor = UsageDescriptor("Build", data)