diff --git a/.idea/modules.xml b/.idea/modules.xml
index 3cba896781ea..12f0fa844487 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -658,6 +658,7 @@
+
diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/DistributionJARsBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/DistributionJARsBuilder.groovy
index 9497f7ce7c79..69ddacb8e538 100644
--- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/DistributionJARsBuilder.groovy
+++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/DistributionJARsBuilder.groovy
@@ -145,6 +145,7 @@ class DistributionJARsBuilder {
withModule("intellij.json")
withModule("intellij.spellchecker")
withModule("intellij.platform.images")
+ withModule("intellij.platform.statistics")
withModule("intellij.relaxng", "intellij-xml.jar")
withModule("intellij.xml.analysis.impl", "intellij-xml.jar")
diff --git a/platform/core-api/src/com/intellij/ide/plugins/PluginInfoProvider.java b/platform/core-api/src/com/intellij/ide/plugins/PluginInfoProvider.java
new file mode 100644
index 000000000000..78fdbc13746a
--- /dev/null
+++ b/platform/core-api/src/com/intellij/ide/plugins/PluginInfoProvider.java
@@ -0,0 +1,21 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package com.intellij.ide.plugins;
+
+import com.intellij.openapi.progress.ProgressIndicator;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.List;
+
+public interface PluginInfoProvider {
+
+ /**
+ * Reads cached plugin descriptors from a file. Returns {@code null} if cache file does not exist.
+ */
+ List loadCachedPlugins() throws IOException;
+
+ /**
+ * Loads list of plugins, compatible with a current build, from a main plugin repository.
+ */
+ List loadPlugins(@Nullable ProgressIndicator indicator) throws IOException;
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/statistics/ExternalSystemActionsCollector.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/statistics/ExternalSystemActionsCollector.kt
index 5731915d36db..80f4cc9337df 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/statistics/ExternalSystemActionsCollector.kt
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/statistics/ExternalSystemActionsCollector.kt
@@ -29,7 +29,7 @@ class ExternalSystemActionsCollector {
if (place != null) {
data.addPlace(place).addData("context_menu", isFromContextMenu)
}
- executor?.let { data.addExecutor(it) }
+ executor?.let { data.addData("executor", it.id) }
addExternalSystemId(data, systemId)
diff --git a/platform/lang-impl/src/com/intellij/execution/impl/statistics/RunConfigurationUsageTriggerCollector.java b/platform/lang-impl/src/com/intellij/execution/impl/statistics/RunConfigurationUsageTriggerCollector.java
index 7c589efb6eee..049015fc1867 100644
--- a/platform/lang-impl/src/com/intellij/execution/impl/statistics/RunConfigurationUsageTriggerCollector.java
+++ b/platform/lang-impl/src/com/intellij/execution/impl/statistics/RunConfigurationUsageTriggerCollector.java
@@ -22,7 +22,7 @@ public class RunConfigurationUsageTriggerCollector {
public static IdeActivity trigger(@NotNull Project project, @NotNull ConfigurationFactory factory, @NotNull Executor executor) {
final ConfigurationType configurationType = factory.getType();
return new IdeActivity(project, "run.configuration.exec").startedWithData(data -> {
- data.addAll(newFeatureUsageData(configurationType, factory).addExecutor(executor));
+ data.addAll(newFeatureUsageData(configurationType, factory).addData("executor", executor.getId()));
});
}
diff --git a/platform/platform-impl/intellij.platform.ide.impl.iml b/platform/platform-impl/intellij.platform.ide.impl.iml
index fb0a2e493f0d..13200e9d31e1 100644
--- a/platform/platform-impl/intellij.platform.ide.impl.iml
+++ b/platform/platform-impl/intellij.platform.ide.impl.iml
@@ -66,5 +66,6 @@
+
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginInfoProviderImpl.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginInfoProviderImpl.java
new file mode 100644
index 000000000000..07535a608173
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginInfoProviderImpl.java
@@ -0,0 +1,20 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package com.intellij.ide.plugins;
+
+import com.intellij.openapi.progress.ProgressIndicator;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.List;
+
+public class PluginInfoProviderImpl implements PluginInfoProvider {
+ @Override
+ public List loadCachedPlugins() throws IOException {
+ return RepositoryHelper.loadCachedPlugins();
+ }
+
+ @Override
+ public List loadPlugins(@Nullable ProgressIndicator indicator) throws IOException {
+ return RepositoryHelper.loadPlugins(indicator);
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/DeviceIdManager.kt b/platform/platform-impl/src/com/intellij/internal/statistic/DeviceIdManager.kt
deleted file mode 100644
index 85548170183e..000000000000
--- a/platform/platform-impl/src/com/intellij/internal/statistic/DeviceIdManager.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package com.intellij.internal.statistic
-
-import com.intellij.openapi.application.PermanentInstallationID
-import com.intellij.openapi.application.ex.ApplicationInfoEx
-import com.intellij.openapi.application.impl.ApplicationInfoImpl
-import com.intellij.openapi.diagnostic.Logger
-import com.intellij.openapi.util.SystemInfo
-import com.intellij.openapi.util.text.StringUtil
-import java.text.SimpleDateFormat
-import java.util.*
-import java.util.prefs.Preferences
-
-object DeviceIdManager {
- private val LOG = Logger.getInstance(DeviceIdManager::class.java)
-
- private const val DEVICE_ID_SHARED_FILE = "PermanentDeviceId"
- private const val DEVICE_ID_PREFERENCE_KEY = "device_id"
-
- fun getOrGenerateId(): String {
- val appInfo = ApplicationInfoImpl.getShadowInstance()
- val prefs = getPreferences(appInfo)
-
- var deviceId = prefs.get(DEVICE_ID_PREFERENCE_KEY, null)
- if (StringUtil.isEmptyOrSpaces(deviceId)) {
- deviceId = generateId(Calendar.getInstance(Locale.ENGLISH), getOSChar())
- prefs.put(DEVICE_ID_PREFERENCE_KEY, deviceId)
- LOG.info("Generating new Device ID")
- }
-
- if (appInfo.isVendorJetBrains && SystemInfo.isWindows) {
- deviceId = PermanentInstallationID.syncWithSharedFile(DEVICE_ID_SHARED_FILE, deviceId, prefs, DEVICE_ID_PREFERENCE_KEY)
- }
-
- return deviceId
- }
-
- private fun getPreferences(appInfo: ApplicationInfoEx): Preferences {
- val companyName = appInfo.shortCompanyName
- val name = if (StringUtil.isEmptyOrSpaces(companyName)) "jetbrains" else companyName.toLowerCase(Locale.US)
- return Preferences.userRoot().node(name)
- }
-
- /**
- * Device id is generating by concatenating following values:
- * Current date, written in format ddMMyy, where year coerced between 2000 and 2099
- * Character, representing user's OS (see [getOSChar])
- * [toString] call on representation of [UUID.randomUUID]
- */
- fun generateId(calendar: Calendar, OSChar: Char): String {
- calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR).coerceIn(2000, 2099))
- return SimpleDateFormat("ddMMyy", Locale.ENGLISH).format(calendar.time) + OSChar + UUID.randomUUID().toString()
- }
-
- private fun getOSChar() = if (SystemInfo.isWindows) '1' else if (SystemInfo.isMac) '2' else if (SystemInfo.isLinux) '3' else '0'
-}
\ No newline at end of file
diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
index 36d743f40051..e4de2723aa41 100644
--- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml
+++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
@@ -307,6 +307,8 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/AbstractProjectsUsagesCollector.java b/platform/statistics/src/com/intellij/internal/statistic/AbstractProjectsUsagesCollector.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/AbstractProjectsUsagesCollector.java
rename to platform/statistics/src/com/intellij/internal/statistic/AbstractProjectsUsagesCollector.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/CollectUsagesException.java b/platform/statistics/src/com/intellij/internal/statistic/CollectUsagesException.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/CollectUsagesException.java
rename to platform/statistics/src/com/intellij/internal/statistic/CollectUsagesException.java
diff --git a/platform/statistics/src/com/intellij/internal/statistic/DeviceIdManager.java b/platform/statistics/src/com/intellij/internal/statistic/DeviceIdManager.java
new file mode 100644
index 000000000000..d94ec43cb6de
--- /dev/null
+++ b/platform/statistics/src/com/intellij/internal/statistic/DeviceIdManager.java
@@ -0,0 +1,117 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package com.intellij.internal.statistic;
+
+import com.intellij.openapi.application.ex.ApplicationInfoEx;
+import com.intellij.openapi.application.impl.ApplicationInfoImpl;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.io.FileUtilRt;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Locale;
+import java.util.UUID;
+import java.util.prefs.Preferences;
+
+public class DeviceIdManager {
+ private static final Logger LOG = Logger.getInstance(DeviceIdManager.class);
+
+ private static final String DEVICE_ID_SHARED_FILE = "PermanentDeviceId";
+ private static final String DEVICE_ID_PREFERENCE_KEY = "device_id";
+
+ public static String getOrGenerateId() {
+ ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
+ Preferences prefs = getPreferences(appInfo);
+
+ String deviceId = prefs.get(DEVICE_ID_PREFERENCE_KEY, null);
+ if (StringUtil.isEmptyOrSpaces(deviceId)) {
+ deviceId = generateId(Calendar.getInstance(Locale.ENGLISH), getOSChar());
+ prefs.put(DEVICE_ID_PREFERENCE_KEY, deviceId);
+ LOG.info("Generating new Device ID");
+ }
+
+ if (appInfo.isVendorJetBrains() && SystemInfo.isWindows) {
+ deviceId = syncWithSharedFile(DEVICE_ID_SHARED_FILE, deviceId, prefs, DEVICE_ID_PREFERENCE_KEY);
+ }
+ return deviceId;
+ }
+
+ @NotNull
+ public static String syncWithSharedFile(@NotNull String fileName,
+ @NotNull String installationId,
+ @NotNull Preferences prefs,
+ @NotNull String prefsKey) {
+ final String appdata = System.getenv("APPDATA");
+ if (appdata != null) {
+ final File dir = new File(appdata, "JetBrains");
+ if (dir.exists() || dir.mkdirs()) {
+ final File permanentIdFile = new File(dir, fileName);
+ try {
+ String fromFile = "";
+ if (permanentIdFile.exists()) {
+ fromFile = loadFromFile(permanentIdFile).trim();
+ }
+ if (!fromFile.isEmpty()) {
+ if (!fromFile.equals(installationId)) {
+ installationId = fromFile;
+ prefs.put(prefsKey, installationId);
+ }
+ }
+ else {
+ writeToFile(permanentIdFile, installationId);
+ }
+ }
+ catch (IOException ignored) { }
+ }
+ }
+ return installationId;
+ }
+
+ @NotNull
+ private static String loadFromFile(@NotNull File file) throws IOException {
+ try (FileInputStream is = new FileInputStream(file)) {
+ final byte[] bytes = FileUtilRt.loadBytes(is);
+ final int offset = CharsetToolkit.hasUTF8Bom(bytes) ? CharsetToolkit.UTF8_BOM.length : 0;
+ return new String(bytes, offset, bytes.length - offset, StandardCharsets.UTF_8);
+ }
+ }
+
+ private static void writeToFile(@NotNull File file, @NotNull String text) throws IOException {
+ try (DataOutputStream stream = new DataOutputStream(new FileOutputStream(file))) {
+ stream.write(text.getBytes(StandardCharsets.UTF_8));
+ }
+ }
+
+ @NotNull
+ private static Preferences getPreferences(ApplicationInfoEx appInfo) {
+ String companyName = appInfo.getShortCompanyName();
+ String name = StringUtil.isEmptyOrSpaces(companyName) ? "jetbrains" : companyName.toLowerCase(Locale.US);
+ return Preferences.userRoot().node(name);
+ }
+
+ /**
+ * Device id is generating by concatenating following values:
+ * Current date, written in format ddMMyy, where year coerced between 2000 and 2099
+ * Character, representing user's OS (see [getOSChar])
+ * [toString] call on representation of [UUID.randomUUID]
+ */
+ public static String generateId(Calendar calendar, char OSChar) {
+ int year = calendar.get(Calendar.YEAR);
+ if (year < 2000) year = 2000;
+ if (year > 2099) year = 2099;
+ calendar.set(Calendar.YEAR, year);
+ return new SimpleDateFormat("ddMMyy", Locale.ENGLISH).format(calendar.getTime()) + OSChar + UUID.randomUUID().toString();
+ }
+
+ private static char getOSChar() {
+ if (SystemInfo.isWindows) return '1';
+ else if (SystemInfo.isMac) return '2';
+ else if (SystemInfo.isLinux) return '3';
+ return '0';
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/IdeActivity.kt b/platform/statistics/src/com/intellij/internal/statistic/IdeActivity.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/IdeActivity.kt
rename to platform/statistics/src/com/intellij/internal/statistic/IdeActivity.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java b/platform/statistics/src/com/intellij/internal/statistic/StatisticsBundle.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/StatisticsBundle.java
rename to platform/statistics/src/com/intellij/internal/statistic/StatisticsBundle.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/UsagesCollector.java b/platform/statistics/src/com/intellij/internal/statistic/UsagesCollector.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/UsagesCollector.java
rename to platform/statistics/src/com/intellij/internal/statistic/UsagesCollector.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/GroupDescriptor.java b/platform/statistics/src/com/intellij/internal/statistic/beans/GroupDescriptor.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/GroupDescriptor.java
rename to platform/statistics/src/com/intellij/internal/statistic/beans/GroupDescriptor.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEvent.kt b/platform/statistics/src/com/intellij/internal/statistic/beans/MetricEvent.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEvent.kt
rename to platform/statistics/src/com/intellij/internal/statistic/beans/MetricEvent.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEventFactory.kt b/platform/statistics/src/com/intellij/internal/statistic/beans/MetricEventFactory.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEventFactory.kt
rename to platform/statistics/src/com/intellij/internal/statistic/beans/MetricEventFactory.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEventUtil.kt b/platform/statistics/src/com/intellij/internal/statistic/beans/MetricEventUtil.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/MetricEventUtil.kt
rename to platform/statistics/src/com/intellij/internal/statistic/beans/MetricEventUtil.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/StatisticsEventProvider.kt b/platform/statistics/src/com/intellij/internal/statistic/beans/StatisticsEventProvider.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/StatisticsEventProvider.kt
rename to platform/statistics/src/com/intellij/internal/statistic/beans/StatisticsEventProvider.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/beans/UsageDescriptor.java b/platform/statistics/src/com/intellij/internal/statistic/beans/UsageDescriptor.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/beans/UsageDescriptor.java
rename to platform/statistics/src/com/intellij/internal/statistic/beans/UsageDescriptor.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/configurable/SendPeriod.java b/platform/statistics/src/com/intellij/internal/statistic/configurable/SendPeriod.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/configurable/SendPeriod.java
rename to platform/statistics/src/com/intellij/internal/statistic/configurable/SendPeriod.java
diff --git a/platform/statistics/src/com/intellij/internal/statistic/connect/SettingsConnectionService.java b/platform/statistics/src/com/intellij/internal/statistic/connect/SettingsConnectionService.java
new file mode 100644
index 000000000000..95c0c0161631
--- /dev/null
+++ b/platform/statistics/src/com/intellij/internal/statistic/connect/SettingsConnectionService.java
@@ -0,0 +1,87 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package com.intellij.internal.statistic.connect;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.io.HttpRequests;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public abstract class SettingsConnectionService {
+ private static final Logger LOG = Logger.getInstance(SettingsConnectionService.class);
+
+ protected static final String SERVICE_URL_ATTR_NAME = "url";
+
+ private Map myAttributesMap;
+
+ @NotNull
+ protected String[] getAttributeNames() {
+ return new String[]{SERVICE_URL_ATTR_NAME};
+ }
+
+ @Nullable
+ private final String mySettingsUrl;
+ @Nullable
+ private final String myDefaultServiceUrl;
+
+ protected SettingsConnectionService(@Nullable String settingsUrl, @Nullable String defaultServiceUrl) {
+ mySettingsUrl = settingsUrl;
+ myDefaultServiceUrl = defaultServiceUrl;
+ }
+
+ @SuppressWarnings("unused")
+ @Deprecated
+ @Nullable
+ public String getSettingsUrl() {
+ return mySettingsUrl;
+ }
+
+ @Nullable
+ public String getDefaultServiceUrl() {
+ return myDefaultServiceUrl;
+ }
+
+ @Nullable
+ private Map readSettings(final String... attributes) {
+ if (mySettingsUrl == null) return Collections.emptyMap();
+ return HttpRequests.request(mySettingsUrl)
+ .productNameAsUserAgent()
+ .connect(request -> {
+ Map settings = new LinkedHashMap<>();
+ try {
+ Element root = JDOMUtil.load(request.getReader());
+ for (String s : attributes) {
+ String attributeValue = root.getAttributeValue(s);
+ if (StringUtil.isNotEmpty(attributeValue)) {
+ settings.put(s, attributeValue);
+ }
+ }
+ }
+ catch (JDOMException e) {
+ LOG.info(e);
+ }
+ return settings;
+ }, Collections.emptyMap(), LOG);
+ }
+
+ @Nullable
+ public String getServiceUrl() {
+ final String serviceUrl = getSettingValue(SERVICE_URL_ATTR_NAME);
+ return serviceUrl == null ? getDefaultServiceUrl() : serviceUrl;
+ }
+
+ @Nullable
+ protected String getSettingValue(@NotNull String attributeValue) {
+ if (myAttributesMap == null || myAttributesMap.isEmpty()) {
+ myAttributesMap = readSettings(getAttributeNames());
+ }
+ return myAttributesMap != null ? myAttributesMap.get(attributeValue) : null;
+ }
+}
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/connect/StatServiceException.java b/platform/statistics/src/com/intellij/internal/statistic/connect/StatServiceException.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/connect/StatServiceException.java
rename to platform/statistics/src/com/intellij/internal/statistic/connect/StatServiceException.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java b/platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java
similarity index 96%
rename from platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java
rename to platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java
index 18aed4fb5382..59ce7426bd8e 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsConnectionService.java
@@ -15,7 +15,6 @@
*/
package com.intellij.internal.statistic.connect;
-import com.intellij.facet.frameworks.SettingsConnectionService;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsResult.java b/platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsResult.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsResult.java
rename to platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsResult.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsService.java b/platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsService.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/connect/StatisticsService.java
rename to platform/statistics/src/com/intellij/internal/statistic/connect/StatisticsService.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogBuildType.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogBuildType.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogBuildType.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogBuildType.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogConfiguration.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogConfiguration.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogConfiguration.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogConfiguration.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java
similarity index 95%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java
index aefad5217348..7e229b09e15b 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogExternalSettingsService.java
@@ -1,10 +1,10 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.eventLog;
-import com.intellij.facet.frameworks.SettingsConnectionService;
+import com.intellij.internal.statistic.connect.SettingsConnectionService;
import com.intellij.internal.statistic.service.fus.FUSWhitelist;
import com.intellij.internal.statistic.service.fus.FUStatisticsWhiteListGroupsService;
-import com.intellij.internal.statistic.utils.StatisticsUploadAssistant;
+import com.intellij.internal.statistic.utils.StatisticsTestHelper;
import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.diagnostic.Logger;
@@ -87,7 +87,7 @@ public class EventLogExternalSettingsService extends SettingsConnectionService i
@Override
public boolean isInternal() {
- return StatisticsUploadAssistant.isTestStatisticsEnabled();
+ return StatisticsTestHelper.isTestStatisticsEnabled();
}
@Nullable
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogFile.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogFile.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogFile.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogFile.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogNotificationProxy.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogNotificationProxy.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogNotificationProxy.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogNotificationProxy.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogResultDecorator.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogResultDecorator.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogResultDecorator.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogResultDecorator.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogSettingsService.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogSettingsService.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogSettingsService.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogSettingsService.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogStatisticsService.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogStatisticsService.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogStatisticsService.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogStatisticsService.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogSystemLogger.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogSystemLogger.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/EventLogSystemLogger.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogSystemLogger.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt
similarity index 98%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt
index 8d7a0bb56306..9e3c28aa4a97 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/FeatureUsageData.kt
@@ -1,7 +1,6 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.eventLog
-import com.intellij.execution.Executor
import com.intellij.internal.statistic.eventLog.StatisticsEventEscaper.escapeFieldName
import com.intellij.internal.statistic.utils.PluginInfo
import com.intellij.internal.statistic.utils.addPluginInfoTo
@@ -188,11 +187,6 @@ class FeatureUsageData {
return ActionPlaces.isCommonPlace(place) || ActionPlaces.TOOLWINDOW_POPUP == place
}
- @FeatureUsageDataBuilder(additionalDataFields = ["executor:util#run_config_executor"])
- fun addExecutor(executor: Executor): FeatureUsageData {
- return addData("executor", executor.id)
- }
-
@FeatureUsageDataBuilder(additionalDataFields = ["file_path:util#hash"])
fun addAnonymizedPath(path: String?): FeatureUsageData {
data["file_path"] = path?.let { EventLogConfiguration.anonymize(path) } ?: "undefined"
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/FeatureUsageDataBuilder.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/FeatureUsageDataBuilder.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/FeatureUsageDataBuilder.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/FeatureUsageDataBuilder.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventFilter.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventFilter.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventFilter.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventFilter.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventRecordRequest.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventRecordRequest.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventRecordRequest.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventRecordRequest.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventSerializer.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventSerializer.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEventSerializer.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEventSerializer.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEvents.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEvents.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/LogEvents.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/LogEvents.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/ShortcutDataProvider.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/ShortcutDataProvider.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/ShortcutDataProvider.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/ShortcutDataProvider.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventEscaper.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventEscaper.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventEscaper.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventEscaper.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogFileAppender.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogFileAppender.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogFileAppender.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogFileAppender.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogWriter.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogWriter.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogWriter.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogWriter.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogger.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogger.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogger.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsEventLogger.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsFileEventLogger.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsFileEventLogger.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/StatisticsFileEventLogger.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/StatisticsFileEventLogger.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageLogger.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageLogger.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageLogger.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageLogger.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageStateEventTracker.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageStateEventTracker.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageStateEventTracker.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/fus/FeatureUsageStateEventTracker.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java
similarity index 94%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java
index 27a96ecee7db..ba5bba2a28a4 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/SensitiveDataValidator.java
@@ -1,9 +1,6 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.eventLog.validator;
-import com.intellij.internal.statistic.collectors.fus.ClassNameRuleValidator;
-import com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionsCollectorImpl;
-import com.intellij.internal.statistic.collectors.fus.fileTypes.FileTypeUsagesCollector;
import com.intellij.internal.statistic.eventLog.EventLogGroup;
import com.intellij.internal.statistic.eventLog.FeatureUsageData;
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
@@ -55,7 +52,7 @@ import static com.intellij.internal.statistic.utils.StatisticsUtilKt.addPluginIn
*
* Custom rule: class which inherits {@link CustomWhiteListRule} and validates dynamic data like action id or file type, e.g.
* "{util#class_name}" checks that the value is a class name from platform, JB plugin or a plugin from JB plugin repository.
- * See: {@link ClassNameRuleValidator}
+ * See: {@link com.intellij.internal.statistic.collectors.fus.ClassNameRuleValidator}
*
*
*
@@ -67,7 +64,9 @@ import static com.intellij.internal.statistic.utils.StatisticsUtilKt.addPluginIn
*
* Example:
*
- * - "actions" collector records invoked actions ({@link ActionsCollectorImpl}).
+ * - "actions" collector records invoked actions
+ * ({@link com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionsCollectorImpl}).
+ *
* It is validated by the following rules:
*
* {
@@ -85,7 +84,9 @@ import static com.intellij.internal.statistic.utils.StatisticsUtilKt.addPluginIn
* }
*
*
- * - "file.types" collector records information about project files ({@link FileTypeUsagesCollector}).
+ * - "file.types" collector records information about project files
+ * ({@link com.intellij.internal.statistic.collectors.fus.fileTypes.FileTypeUsagesCollector}).
+ *
* It is validated by the following rules:
*
* {
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/ValidationResultType.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/ValidationResultType.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/ValidationResultType.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/ValidationResultType.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/BaseEventLogWhitelistPersistence.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/BaseEventLogWhitelistPersistence.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/BaseEventLogWhitelistPersistence.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/BaseEventLogWhitelistPersistence.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogTestWhitelistPersistence.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogTestWhitelistPersistence.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogTestWhitelistPersistence.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogTestWhitelistPersistence.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistPersistence.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistPersistence.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistPersistence.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistPersistence.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java
similarity index 95%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java
index 7cb08938dfa4..44411d05ce33 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/EventLogWhitelistSettingsPersistence.java
@@ -1,7 +1,6 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.eventLog.validator.persistence;
-import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
import com.intellij.openapi.components.*;
import com.intellij.openapi.util.text.StringUtil;
import org.jdom.Element;
@@ -13,9 +12,11 @@ import java.util.Map;
@State(
name = "EventLogWhitelist",
- storages = @Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED)
+ storages = @Storage(value = EventLogWhitelistSettingsPersistence.USAGE_STATISTICS_XML, roamingType = RoamingType.DISABLED)
)
public class EventLogWhitelistSettingsPersistence implements PersistentStateComponent {
+ public static final String USAGE_STATISTICS_XML = "usage.statistics.xml";
+
private final Map myLastModifications = new HashMap<>();
private final Map myRecorderToPathSettings = new HashMap<>();
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/WhitelistPathSettings.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/WhitelistPathSettings.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/persistence/WhitelistPathSettings.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/persistence/WhitelistPathSettings.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/EventContext.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/EventContext.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/EventContext.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/EventContext.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRegexpAwareRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRegexpAwareRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRegexpAwareRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRegexpAwareRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/FUSRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/PerformanceCareRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/PerformanceCareRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/PerformanceCareRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/PerformanceCareRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupContextData.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupContextData.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupContextData.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupContextData.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java
index 93e9066d3021..aa7f3d5c25a7 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/beans/WhiteListGroupRules.java
@@ -2,8 +2,8 @@
package com.intellij.internal.statistic.eventLog.validator.rules.beans;
import com.intellij.internal.statistic.eventLog.FeatureUsageData;
-import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
+import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule;
import com.intellij.internal.statistic.eventLog.validator.rules.impl.EnumWhiteListRule;
import com.intellij.internal.statistic.eventLog.validator.rules.utils.WhiteListSimpleRuleFactory;
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java
similarity index 93%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java
index e9e5ec578ebd..a16f6b0e2348 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/CustomWhiteListRule.java
@@ -1,8 +1,6 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.eventLog.validator.rules.impl;
-import com.intellij.internal.statistic.collectors.fus.ClassNameRuleValidator;
-import com.intellij.internal.statistic.collectors.fus.LangCustomRuleValidator;
import com.intellij.internal.statistic.eventLog.validator.SensitiveDataValidator;
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
@@ -25,7 +23,9 @@ import org.jetbrains.annotations.Nullable;
* For more information see {@link SensitiveDataValidator}.
*
*
- * Example: {@link ClassNameRuleValidator}, {@link LangCustomRuleValidator}, etc.
+ * Example:
+ * {@link com.intellij.internal.statistic.collectors.fus.ClassNameRuleValidator},
+ * {@link com.intellij.internal.statistic.collectors.fus.LangCustomRuleValidator}, etc.
*
* @see SensitiveDataValidator
*/
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/EnumWhiteListRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/EnumWhiteListRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/EnumWhiteListRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/EnumWhiteListRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalEnumCustomWhitelistRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalEnumCustomWhitelistRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalEnumCustomWhitelistRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalEnumCustomWhitelistRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java
similarity index 96%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java
index 06cf66de300e..cbd55d170353 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/LocalFileCustomWhiteListRule.java
@@ -10,7 +10,10 @@ import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.lang.ref.WeakReference;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/RegexpWhiteListRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/RegexpWhiteListRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/RegexpWhiteListRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/RegexpWhiteListRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/TestModeValidationRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/TestModeValidationRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/TestModeValidationRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/TestModeValidationRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/UtilExpressionWhiteListRule.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/UtilExpressionWhiteListRule.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/UtilExpressionWhiteListRule.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/impl/UtilExpressionWhiteListRule.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java
similarity index 96%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java
index 17deb16e9a1c..7018dea9bfbe 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/validator/rules/utils/WhiteListSimpleRuleFactory.java
@@ -5,14 +5,16 @@ import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRegexpAwareRule;
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule;
import com.intellij.internal.statistic.eventLog.validator.rules.beans.WhiteListGroupContextData;
-import com.intellij.internal.statistic.eventLog.validator.rules.impl.*;
+import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomWhiteListRule;
+import com.intellij.internal.statistic.eventLog.validator.rules.impl.EnumWhiteListRule;
+import com.intellij.internal.statistic.eventLog.validator.rules.impl.RegexpWhiteListRule;
+import com.intellij.internal.statistic.eventLog.validator.rules.impl.UtilExpressionWhiteListRule;
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.SmartList;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/BaseWhitelistStorage.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/BaseWhitelistStorage.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/BaseWhitelistStorage.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/BaseWhitelistStorage.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/CompositeWhitelistStorage.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/CompositeWhitelistStorage.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/CompositeWhitelistStorage.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/CompositeWhitelistStorage.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhiteListGroupRulesStorage.kt b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhiteListGroupRulesStorage.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhiteListGroupRulesStorage.kt
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhiteListGroupRulesStorage.kt
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorage.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorage.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorage.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorage.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorageProvider.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorageProvider.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorageProvider.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistStorageProvider.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistTestGroupStorage.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistTestGroupStorage.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistTestGroupStorage.java
rename to platform/statistics/src/com/intellij/internal/statistic/eventLog/whitelist/WhitelistTestGroupStorage.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/persistence/ApprovedGroupsCacheConfigurable.java b/platform/statistics/src/com/intellij/internal/statistic/persistence/ApprovedGroupsCacheConfigurable.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/persistence/ApprovedGroupsCacheConfigurable.java
rename to platform/statistics/src/com/intellij/internal/statistic/persistence/ApprovedGroupsCacheConfigurable.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/FUSWhitelist.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/FUSWhitelist.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/FUSWhitelist.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/FUSWhitelist.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/FUStatisticsWhiteListGroupsService.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/FUStatisticsWhiteListGroupsService.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/FUStatisticsWhiteListGroupsService.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/FUStatisticsWhiteListGroupsService.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/ApplicationUsagesCollector.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/ApplicationUsagesCollector.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/ApplicationUsagesCollector.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/ApplicationUsagesCollector.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/CounterUsageCollectorEP.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/CounterUsageCollectorEP.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/CounterUsageCollectorEP.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/CounterUsageCollectorEP.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUCounterUsageLogger.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUCounterUsageLogger.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUCounterUsageLogger.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUCounterUsageLogger.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java
similarity index 98%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java
index 3d070cc97eb5..bf9fcdd3431b 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUStateUsagesLogger.java
@@ -17,8 +17,6 @@ import java.util.Collections;
import java.util.Map;
import java.util.Set;
-import static com.intellij.internal.statistic.utils.StatisticsUploadAssistant.LOCK;
-
/**
* Called by a scheduler once a day and records IDE/project state.
*
@@ -28,6 +26,8 @@ import static com.intellij.internal.statistic.utils.StatisticsUploadAssistant.LO
* To record IDE events (e.g. invoked action, opened dialog) use {@link FUCounterUsageLogger}
*/
public class FUStateUsagesLogger implements UsagesCollectorConsumer {
+ public static final Object LOCK = new Object();
+
/**
* System event which indicates that the collector was called.
* Used to calculate metric baseline.
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUStatisticsPersistence.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUStatisticsPersistence.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FUStatisticsPersistence.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FUStatisticsPersistence.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FeatureUsagesCollector.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FeatureUsagesCollector.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/FeatureUsagesCollector.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/FeatureUsagesCollector.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java
similarity index 85%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java
index 8a09367ae5df..6431334805b6 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java
+++ b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/LegacyFUSProjectUsageTrigger.java
@@ -1,7 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.service.fus.collectors;
-import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
+import com.intellij.internal.statistic.eventLog.validator.persistence.EventLogWhitelistSettingsPersistence;
import com.intellij.openapi.components.*;
import com.intellij.openapi.project.Project;
import com.intellij.util.SmartList;
@@ -13,7 +13,7 @@ import java.util.List;
@State(name = "FUSProjectUsageTrigger", storages = {
@Storage(value = StoragePathMacros.CACHE_FILE, deprecated = true),
@Storage(value = StoragePathMacros.WORKSPACE_FILE, deprecated = true),
- @Storage(value = UsageStatisticsPersistenceComponent.USAGE_STATISTICS_XML, deprecated = true),
+ @Storage(value = EventLogWhitelistSettingsPersistence.USAGE_STATISTICS_XML, deprecated = true),
})
final public class LegacyFUSProjectUsageTrigger implements PersistentStateComponent {
private final State myState = new State();
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/ProjectUsagesCollector.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/ProjectUsagesCollector.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/ProjectUsagesCollector.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/ProjectUsagesCollector.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/UsageDescriptorKeyValidator.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UsageDescriptorKeyValidator.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/UsageDescriptorKeyValidator.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UsageDescriptorKeyValidator.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/UsagesCollectorConsumer.java b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UsagesCollectorConsumer.java
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/service/fus/collectors/UsagesCollectorConsumer.java
rename to platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UsagesCollectorConsumer.java
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/utils/PluginInfoDetector.kt b/platform/statistics/src/com/intellij/internal/statistic/utils/PluginInfoDetector.kt
similarity index 100%
rename from platform/platform-impl/src/com/intellij/internal/statistic/utils/PluginInfoDetector.kt
rename to platform/statistics/src/com/intellij/internal/statistic/utils/PluginInfoDetector.kt
diff --git a/platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsTestHelper.java b/platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsTestHelper.java
new file mode 100644
index 000000000000..bedff81cdeac
--- /dev/null
+++ b/platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsTestHelper.java
@@ -0,0 +1,12 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package com.intellij.internal.statistic.utils;
+
+import com.intellij.openapi.util.text.StringUtil;
+
+public class StatisticsTestHelper {
+ private static final String ENABLE_LOCAL_STATISTICS_WITHOUT_REPORT = "idea.local.statistics.without.report";
+
+ public static boolean isTestStatisticsEnabled() {
+ return Boolean.getBoolean(ENABLE_LOCAL_STATISTICS_WITHOUT_REPORT) || StringUtil.isNotEmpty(System.getenv("TEAMCITY_VERSION"));
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt b/platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt
similarity index 95%
rename from platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt
rename to platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt
index 47d1dde62736..4be1dbf22f5e 100644
--- a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt
+++ b/platform/statistics/src/com/intellij/internal/statistic/utils/StatisticsUtil.kt
@@ -1,13 +1,14 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.internal.statistic.utils
+import com.intellij.ide.plugins.PluginInfoProvider
import com.intellij.ide.plugins.PluginManager
import com.intellij.ide.plugins.PluginManagerCore
-import com.intellij.ide.plugins.RepositoryHelper
import com.intellij.internal.statistic.beans.*
import com.intellij.internal.statistic.eventLog.EventLogConfiguration
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ex.ApplicationInfoEx
+import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.extensions.PluginDescriptor
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.project.Project
@@ -203,7 +204,7 @@ private fun addAll(result: ObjectIntHashMap, usages: Set> = TimeoutCachedValue(1, TimeUnit.HOURS) {
// before loading default repository plugins lets check it's not changed, and is really official JetBrains repository
try {
- val cached = RepositoryHelper.loadCachedPlugins()
+ val cached = getPluginInfoProvider()?.loadCachedPlugins()
if (cached != null) {
return@TimeoutCachedValue cached.mapNotNullTo(HashSet(cached.size)) { it.pluginId }
}
@@ -214,7 +215,7 @@ private val pluginIdsFromOfficialJbPluginRepo: Getter> = TimeoutCa
// schedule plugins loading, will take them the next time
ApplicationManager.getApplication().executeOnPooledThread {
try {
- RepositoryHelper.loadPlugins(null)
+ getPluginInfoProvider()?.loadPlugins(null) ?: emptySet()
}
catch (ignored: IOException) {
}
@@ -224,6 +225,10 @@ private val pluginIdsFromOfficialJbPluginRepo: Getter> = TimeoutCa
emptySet()
}
+fun getPluginInfoProvider(): PluginInfoProvider? {
+ return ApplicationManager.getApplication()?.let { ServiceManager.getService(PluginInfoProvider::class.java) }
+}
+
/**
* Checks this plugin is created by JetBrains or from official repository, so API from it may be reported
*/
diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenActionsUsagesCollector.kt b/plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenActionsUsagesCollector.kt
index 08ceb1bd5b2c..0682b6759539 100644
--- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenActionsUsagesCollector.kt
+++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenActionsUsagesCollector.kt
@@ -29,7 +29,7 @@ class MavenActionsUsagesCollector {
if (place != null) {
data.addPlace(place).addData("context_menu", isFromContextMenu)
}
- executor?.let { data.addExecutor(it) }
+ executor?.let { data.addData("executor", it.id) }
FUCounterUsageLogger.getInstance().logEvent(GROUP_ID, actionID.name, data)
}