From 0a95feb352f7d5f7e1a1914238f958d8b4bed67e Mon Sep 17 00:00:00 2001 From: Victor Matchenko Date: Tue, 7 Mar 2023 17:48:27 +0100 Subject: [PATCH] IDEA-314605 disable ability to substitute template url Remove old deprecated EventLogEndpointSubstitutor EP GitOrigin-RevId: 1158e0665e850f1d99554f50d2723b4b6e8c2c04 --- build/tasks/resources/linux/class-report.txt | 1 - build/tasks/resources/mac/class-report.txt | 1 - .../tasks/resources/windows/class-report.txt | 1 - .../src/META-INF/PlatformExtensionPoints.xml | 1 - .../ConfigEndpointSubstitutorTest.kt | 32 ------------------- .../ExternalEventLogSettingsTest.kt | 2 +- .../eventLog/EventLogEndpointSubstitutor.java | 30 ----------------- .../EventLogInternalApplicationInfo.java | 19 +---------- .../eventLog/ExternalEventLogSettings.java | 9 ++++-- 9 files changed, 9 insertions(+), 87 deletions(-) delete mode 100644 platform/platform-tests/testSrc/com/intellij/internal/statistics/ConfigEndpointSubstitutorTest.kt delete mode 100644 platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogEndpointSubstitutor.java diff --git a/build/tasks/resources/linux/class-report.txt b/build/tasks/resources/linux/class-report.txt index 5070a51a23c9..505549fbd1b2 100644 --- a/build/tasks/resources/linux/class-report.txt +++ b/build/tasks/resources/linux/class-report.txt @@ -4231,7 +4231,6 @@ io/netty/handler/codec/http/HttpObject.class:lib/util-8.jar io/netty/handler/codec/http/HttpMessage.class:lib/util-8.jar io/netty/handler/codec/http/HttpRequest.class:lib/util-8.jar com/intellij/ide/ui/laf/LafManagerImpl$settingsToolbar$1.class:lib/app.jar -com/intellij/internal/statistic/eventLog/EventLogEndpointSubstitutor.class:lib/stats.jar com/intellij/openapi/vfs/DiskQueryRelay.class:lib/app.jar com/intellij/openapi/vfs/newvfs/persistent/PersistentFSSynchronizedRecordsStorage.class:lib/app.jar it/unimi/dsi/fastutil/longs/LongIterable.class:lib/util-8.jar diff --git a/build/tasks/resources/mac/class-report.txt b/build/tasks/resources/mac/class-report.txt index 5070a51a23c9..505549fbd1b2 100644 --- a/build/tasks/resources/mac/class-report.txt +++ b/build/tasks/resources/mac/class-report.txt @@ -4231,7 +4231,6 @@ io/netty/handler/codec/http/HttpObject.class:lib/util-8.jar io/netty/handler/codec/http/HttpMessage.class:lib/util-8.jar io/netty/handler/codec/http/HttpRequest.class:lib/util-8.jar com/intellij/ide/ui/laf/LafManagerImpl$settingsToolbar$1.class:lib/app.jar -com/intellij/internal/statistic/eventLog/EventLogEndpointSubstitutor.class:lib/stats.jar com/intellij/openapi/vfs/DiskQueryRelay.class:lib/app.jar com/intellij/openapi/vfs/newvfs/persistent/PersistentFSSynchronizedRecordsStorage.class:lib/app.jar it/unimi/dsi/fastutil/longs/LongIterable.class:lib/util-8.jar diff --git a/build/tasks/resources/windows/class-report.txt b/build/tasks/resources/windows/class-report.txt index 5070a51a23c9..505549fbd1b2 100644 --- a/build/tasks/resources/windows/class-report.txt +++ b/build/tasks/resources/windows/class-report.txt @@ -4231,7 +4231,6 @@ io/netty/handler/codec/http/HttpObject.class:lib/util-8.jar io/netty/handler/codec/http/HttpMessage.class:lib/util-8.jar io/netty/handler/codec/http/HttpRequest.class:lib/util-8.jar com/intellij/ide/ui/laf/LafManagerImpl$settingsToolbar$1.class:lib/app.jar -com/intellij/internal/statistic/eventLog/EventLogEndpointSubstitutor.class:lib/stats.jar com/intellij/openapi/vfs/DiskQueryRelay.class:lib/app.jar com/intellij/openapi/vfs/newvfs/persistent/PersistentFSSynchronizedRecordsStorage.class:lib/app.jar it/unimi/dsi/fastutil/longs/LongIterable.class:lib/util-8.jar diff --git a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml index c81f5a21912d..be638be6b3a1 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml @@ -196,7 +196,6 @@ - EP_NAME = new ExtensionPointName<>("com.intellij.statistic.eventLog.eventLogEndpointSubstitutor"); - - /** - * @deprecated Endpoint shouldn't depend on recorder id. Use {@link #getTemplateUrl()} - */ - @Deprecated - @Nullable String getTemplateUrl(@NotNull String recorderId); - - /** - * Provides a custom endpoint for fetching configuration - * @return Remote endpoint URL or null if platform default should be used - */ - default @Nullable String getTemplateUrl() { - return getTemplateUrl("UNDEFINED"); - } -} diff --git a/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogInternalApplicationInfo.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogInternalApplicationInfo.java index 9eab2475bf49..d81d69094316 100644 --- a/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogInternalApplicationInfo.java +++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/EventLogInternalApplicationInfo.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.internal.statistic.eventLog; import com.intellij.internal.statistic.eventLog.connection.EventLogConnectionSettings; @@ -44,23 +44,6 @@ public class EventLogInternalApplicationInfo implements EventLogApplicationInfo @NotNull @Override public String getTemplateUrl() { - ExternalEventLogSettings externalEventLogSettings = StatisticsEventLogProviderUtil.getExternalEventLogSettings(); - if (externalEventLogSettings != null) { - String result = externalEventLogSettings.getTemplateUrl(); - return result == null ? getDefaultTemplateUrl() : result; - } - else if (ApplicationManager.getApplication().getExtensionArea().hasExtensionPoint(EventLogEndpointSubstitutor.EP_NAME.getName())) { - EventLogEndpointSubstitutor validSubstitutor = EventLogEndpointSubstitutor.EP_NAME.findFirstSafe(substitutor -> { - return PluginInfoDetectorKt.getPluginInfo(substitutor.getClass()).isAllowedToInjectIntoFUS(); - }); - - String result = validSubstitutor == null ? null : validSubstitutor.getTemplateUrl(); - return result == null ? getDefaultTemplateUrl() : result; - } - return getDefaultTemplateUrl(); - } - - private static String getDefaultTemplateUrl() { return ((ApplicationInfoImpl)ApplicationInfoImpl.getShadowInstance()).getEventLogSettingsUrl(); } diff --git a/platform/statistics/src/com/intellij/internal/statistic/eventLog/ExternalEventLogSettings.java b/platform/statistics/src/com/intellij/internal/statistic/eventLog/ExternalEventLogSettings.java index 06c7376cd93d..a4a180510ad9 100644 --- a/platform/statistics/src/com/intellij/internal/statistic/eventLog/ExternalEventLogSettings.java +++ b/platform/statistics/src/com/intellij/internal/statistic/eventLog/ExternalEventLogSettings.java @@ -25,13 +25,18 @@ public interface ExternalEventLogSettings { /** * @deprecated Endpoint shouldn't depend on recorder id. Use {@link #getTemplateUrl()} */ - @Deprecated - @Nullable String getTemplateUrl(@NotNull String recorderId); + @Deprecated(since = "2022.2") + default @Nullable String getTemplateUrl(@NotNull String recorderId) { + return null; + } /** * Provides a custom endpoint for fetching configuration + * * @return Remote endpoint URL or null if platform default should be used + * @deprecated functionality is disabled */ + @Deprecated(since = "2023.1") default @Nullable String getTemplateUrl() { return getTemplateUrl("UNDEFINED"); }