From 28faf35ead2128145b003b190750fd14f62c1b1c Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Thu, 19 Mar 2020 16:44:46 +0100 Subject: [PATCH] Remove deprecated APIs since at least 6.7 --- .../org/sonar/server/ui/DeprecatedViews.java | 61 ------ .../org/sonar/server/ui/PageDecorations.java | 48 ----- .../sonar/server/ui/DeprecatedViewsTest.java | 101 --------- .../sonar/server/ui/PageDecorationsTest.java | 46 ---- .../platformlevel/PlatformLevel4.java | 4 - .../java/org/sonar/api/CoreProperties.java | 95 -------- .../java/org/sonar/api/SonarQubeVersion.java | 13 -- .../main/java/org/sonar/api/i18n/I18n.java | 2 +- .../java/org/sonar/api/platform/Server.java | 1 - .../scan/issue/filter/FilterableIssue.java | 7 - .../api/web/AbstractDashboardWidget.java | 38 ---- .../sonar/api/web/AbstractRubyTemplate.java | 89 -------- .../java/org/sonar/api/web/Dashboard.java | 203 ------------------ .../org/sonar/api/web/DashboardLayout.java | 77 ------- .../org/sonar/api/web/DashboardTemplate.java | 47 ---- .../java/org/sonar/api/web/DefaultTab.java | 39 ---- .../java/org/sonar/api/web/Description.java | 35 --- .../main/java/org/sonar/api/web/Footer.java | 38 ---- .../org/sonar/api/web/NavigationSection.java | 61 ------ .../src/main/java/org/sonar/api/web/Page.java | 29 --- .../org/sonar/api/web/PageDecoration.java | 34 --- .../org/sonar/api/web/ResourceLanguage.java | 44 ---- .../org/sonar/api/web/ResourceQualifier.java | 44 ---- .../java/org/sonar/api/web/ResourceScope.java | 44 ---- .../java/org/sonar/api/web/RubyRailsPage.java | 34 --- .../org/sonar/api/web/RubyRailsWidget.java | 42 ---- .../main/java/org/sonar/api/web/Section.java | 29 --- .../src/main/java/org/sonar/api/web/View.java | 37 ---- .../java/org/sonar/api/web/Webservice.java | 41 ---- .../main/java/org/sonar/api/web/Widget.java | 28 --- .../org/sonar/api/web/WidgetCategory.java | 36 ---- .../java/org/sonar/api/web/WidgetLayout.java | 36 ---- .../org/sonar/api/web/WidgetLayoutType.java | 29 --- .../org/sonar/api/web/WidgetProperties.java | 32 --- .../org/sonar/api/web/WidgetProperty.java | 60 ------ .../org/sonar/api/web/WidgetPropertyType.java | 95 -------- .../java/org/sonar/api/web/WidgetScope.java | 46 ---- .../api/web/AbstractRubyTemplateTest.java | 71 ------ .../java/org/sonar/api/web/DashboardTest.java | 84 -------- .../bootstrap/ScannerWsClientProvider.java | 2 +- .../scanner/issue/DefaultFilterableIssue.java | 15 +- .../org/sonar/scanner/issue/IssueFilters.java | 13 +- .../issue/DefaultFilterableIssueTest.java | 10 +- 43 files changed, 12 insertions(+), 1928 deletions(-) delete mode 100644 server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/DeprecatedViews.java delete mode 100644 server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/PageDecorations.java delete mode 100644 server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/DeprecatedViewsTest.java delete mode 100644 server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/PageDecorationsTest.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractRubyTemplate.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Dashboard.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardLayout.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardTemplate.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/DefaultTab.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Footer.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/NavigationSection.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Page.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceLanguage.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceQualifier.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceScope.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsPage.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsWidget.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Section.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/View.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Webservice.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/Widget.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetCategory.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetScope.java delete mode 100644 sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java delete mode 100644 sonar-plugin-api/src/test/java/org/sonar/api/web/DashboardTest.java diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/DeprecatedViews.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/DeprecatedViews.java deleted file mode 100644 index 9e3e69b6244..00000000000 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/DeprecatedViews.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.ui; - -import org.sonar.api.Startable; -import org.sonar.api.server.ServerSide; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; -import org.sonar.api.web.View; -import org.sonar.api.web.Widget; -import org.sonar.api.web.page.PageDefinition; - -/** - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class logs warnings at startup if there are pages using the old page API. - */ -@ServerSide -@Deprecated -public class DeprecatedViews implements Startable { - - private static final Logger LOGGER = Loggers.get(DeprecatedViews.class); - - private final View[] views; - - public DeprecatedViews() { - this.views = new View[0]; - } - - public DeprecatedViews(View[] views) { - this.views = views; - } - - @Override - public void start() { - for (View view : views) { - String pageOrWidget = view instanceof Widget ? "Widget" : "Page"; - LOGGER.warn("{} '{}' ({}) is ignored. See {} to define pages.", pageOrWidget, view.getTitle(), view.getId(), PageDefinition.class.getCanonicalName()); - } - } - - @Override - public void stop() { - // do nothing - } -} diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/PageDecorations.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/PageDecorations.java deleted file mode 100644 index 1ac6658a8ea..00000000000 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/PageDecorations.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.ui; - -import java.util.Collections; -import java.util.List; -import org.sonar.api.server.ServerSide; -import org.sonar.api.web.PageDecoration; - -/** - * @since 3.3 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class has not effect. - */ -@ServerSide -@Deprecated -public final class PageDecorations { - - private final PageDecoration[] decorations; - - public PageDecorations(List decorations) { - this.decorations = decorations.toArray(new PageDecoration[decorations.size()]); - } - - public PageDecorations() { - this(Collections.emptyList()); - } - - public PageDecoration[] get() { - return decorations;// NOSONAR expose internal representation - } -} diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/DeprecatedViewsTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/DeprecatedViewsTest.java deleted file mode 100644 index 2aa7516aff5..00000000000 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/DeprecatedViewsTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.ui; - -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.utils.log.LogTester; -import org.sonar.api.utils.log.LoggerLevel; -import org.sonar.api.web.Page; -import org.sonar.api.web.View; -import org.sonar.api.web.Widget; - -import static org.assertj.core.api.Assertions.assertThat; - -public class DeprecatedViewsTest { - - @Rule - public LogTester logger = new LogTester(); - - private DeprecatedViews underTest; - - @Test - public void no_log_when_no_views() { - underTest = new DeprecatedViews(); - underTest.start(); - - assertThat(logger.logs()).isEmpty(); - } - - @Test - public void log_one_warning_by_view() { - underTest = new DeprecatedViews(new View[] { - new FakePage("governance/my_page", "My Page"), - new FakeWidget("governance/my_widget", "My Widget")}); - assertThat(logger.logs()).isEmpty(); - - underTest.start(); - - assertThat(logger.logs()).hasSize(2); - assertThat(logger.logs(LoggerLevel.WARN)).containsExactly( - "Page 'My Page' (governance/my_page) is ignored. See org.sonar.api.web.page.PageDefinition to define pages.", - "Widget 'My Widget' (governance/my_widget) is ignored. See org.sonar.api.web.page.PageDefinition to define pages."); - } - - private static final class FakeWidget implements Widget { - private final String id; - private final String name; - - private FakeWidget(String id, String name) { - this.id = id; - this.name = name; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getTitle() { - return name; - } - } - - private static class FakePage implements Page { - private final String id; - private final String name; - - FakePage(String id, String name) { - this.id = id; - this.name = name; - } - - @Override - public String getId() { - return id; - } - - @Override - public String getTitle() { - return name; - } - } -} diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/PageDecorationsTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/PageDecorationsTest.java deleted file mode 100644 index c63adc07431..00000000000 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/PageDecorationsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.ui; - -import org.junit.Test; -import org.sonar.api.web.PageDecoration; - -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; - -public class PageDecorationsTest { - - @Test - public void should_not_fail_if_no_decorations() { - assertThat(new PageDecorations().get()).isEmpty(); - } - - @Test - public void should_register_decorations() { - PageDecoration deco1 = mock(PageDecoration.class); - PageDecoration deco2 = mock(PageDecoration.class); - - PageDecorations decorations = new PageDecorations(Arrays.asList(deco1, deco2)); - - assertThat(decorations.get()).hasSize(2); - } -} diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index e53a13750b0..fbada5ddc07 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -192,8 +192,6 @@ import org.sonar.server.telemetry.TelemetryDaemon; import org.sonar.server.telemetry.TelemetryDataJsonWriter; import org.sonar.server.telemetry.TelemetryDataLoaderImpl; import org.sonar.server.text.MacroInterpreter; -import org.sonar.server.ui.DeprecatedViews; -import org.sonar.server.ui.PageDecorations; import org.sonar.server.ui.PageRepository; import org.sonar.server.ui.WebAnalyticsLoaderImpl; import org.sonar.server.ui.ws.NavigationWsModule; @@ -250,12 +248,10 @@ public class PlatformLevel4 extends PlatformLevel { LogOAuthWarning.class, PluginDownloader.class, PluginUninstaller.class, - DeprecatedViews.class, PageRepository.class, ResourceTypes.class, DefaultResourceTypes.get(), SettingsChangeNotifier.class, - PageDecorations.class, ServerWs.class, BackendCleanup.class, IndexDefinitions.class, diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index e670edbce3f..a5b3f5fadb0 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -111,13 +111,6 @@ public interface CoreProperties { */ String CATEGORY_SECURITY = "security"; - /** - * @since 2.11 - * @deprecated since 6.0 - */ - @Deprecated - String CATEGORY_JAVA = "java"; - /** * @since 3.3 */ @@ -206,29 +199,6 @@ public interface CoreProperties { String CORE_FORCE_AUTHENTICATION_PROPERTY = "sonar.forceAuthentication"; boolean CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE = false; - /** - * @deprecated since 6.3. This feature is not supported anymore - * @see SONAR-7762/a> - */ - @Deprecated - String CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY = "sonar.allowUsersToSignUp"; - - /** - * @deprecated since 6.4. The default group is hardcoded to 'sonar-users' - * @see SONAR-9014/a> - */ - @Deprecated - String CORE_DEFAULT_GROUP = "sonar.defaultGroup"; - - /** - * @deprecated since 6.4. The default group is hardcoded to 'sonar-users' - * @see SONAR-9014/a> - */ - @Deprecated - String CORE_DEFAULT_GROUP_DEFAULT_VALUE = "sonar-users"; - - boolean CORE_ALLOW_USERS_TO_SIGNUP_DEAULT_VALUE = false; - /** * @deprecated since 2.14. See http://jira.sonarsource.com/browse/SONAR-3153. Replaced by {@link #CORE_AUTHENTICATOR_REALM}. */ @@ -275,15 +245,6 @@ public interface CoreProperties { */ String SERVER_BASE_URL = "sonar.core.serverBaseURL"; - /** - * @see #SERVER_BASE_URL - * @since 2.10 - * @deprecated since 5.6. This constant default value is incorrect if a host and/or a port and/or a context have been configured. - * The correct default value when {@link #SERVER_BASE_URL} is not set is provided by {@link Server#getURL()}. - */ - @Deprecated - String SERVER_BASE_URL_DEFAULT_VALUE = "http://localhost:9000"; - /** * @since 2.11 * @deprecated since 6.7 @@ -296,27 +257,6 @@ public interface CoreProperties { */ String CPD_EXCLUSIONS = "sonar.cpd.exclusions"; - /** - * @since 2.11 - * @deprecated in 6.7. See {@link Server#getPermanentServerId()} - */ - @Deprecated - String ORGANISATION = "sonar.organisation"; - - /** - * @since 2.11 - * @deprecated in 6.7. See {@link Server#getPermanentServerId()} - */ - @Deprecated - String PERMANENT_SERVER_ID = "sonar.server_id"; - - /** - * @since 2.11 - * @deprecated in 6.7. See {@link Server#getPermanentServerId()} - */ - @Deprecated - String SERVER_ID_IP_ADDRESS = "sonar.server_id.ip_address"; - /** * @since 3.3 */ @@ -374,13 +314,6 @@ public interface CoreProperties { // TODO remove? String PROFILING_LOG_PROPERTY = "sonar.showProfiling"; - /** - * @since 4.0 - * @deprecated replaced in 5.2 by the permission 'provisioning' - */ - @Deprecated - String CORE_PREVENT_AUTOMATIC_PROJECT_CREATION = "sonar.preventAutoProjectCreation"; - /** * @since 4.0 */ @@ -394,27 +327,6 @@ public interface CoreProperties { String GLOBAL_WORKING_DIRECTORY = "sonar.globalWorking.directory"; String GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE = ""; - /** - * @since 4.2 - * @deprecated no more used since 5.5 - */ - @Deprecated - String CORE_AUTHENTICATOR_LOCAL_USERS = "sonar.security.localUsers"; - - /** - * @since 4.0 - * @deprecated no more used since 6.3. See https://jira.sonarsource.com/browse/SONAR-8610 - */ - @Deprecated - String HOURS_IN_DAY = "sonar.technicalDebt.hoursInDay"; - - /** - * @since 4.5 - * @deprecated no used anymore since 5.2 - */ - @Deprecated - String SIZE_METRIC = "sonar.technicalDebt.sizeMetric"; - /** * @since 4.5 */ @@ -475,13 +387,6 @@ public interface CoreProperties { */ String SCM_PROVIDER_KEY = "sonar.scm.provider"; - /** - * @since 5.1 - * @deprecated since 6.3. No longer taken into consideration as all files are always imported. - */ - @Deprecated - String IMPORT_UNKNOWN_FILES_KEY = "sonar.import_unknown_files"; - /** * @since 5.1 */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java index 8f491599f0c..47593fe294a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java @@ -137,19 +137,6 @@ import static java.util.Objects.requireNonNull; @Immutable @Deprecated public class SonarQubeVersion { - /** - * Constant for version 5.5 - * @deprecated in 6.0. Please define your own constants. - */ - @Deprecated - public static final Version V5_5 = Version.create(5, 5); - - /** - * Constant for version 5.6 - * @deprecated in 6.0. Please define your own constants. - */ - @Deprecated - public static final Version V5_6 = Version.create(5, 6); private final Version version; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java index b74ad0d7c32..f5c8607c304 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java @@ -29,7 +29,7 @@ import org.sonar.api.server.ServerSide; * Main component that provides translation facilities. * * @since 2.10 - * @deprecated since 7.8 as plugins as no reason to use it anymore + * @deprecated since 7.8 as plugins have no reason to use it anymore */ @ServerSide @ComputeEngineSide diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java index db9bdded0f5..b5e33b23bf1 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java @@ -87,7 +87,6 @@ public abstract class Server { /** * Return the public root url, without trailing slash, for instance : https://nemo.sonarqube.org. - * Default value is {@link org.sonar.api.CoreProperties#SERVER_BASE_URL_DEFAULT_VALUE} * * @since 5.4 */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/issue/filter/FilterableIssue.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/issue/filter/FilterableIssue.java index 4561b9df5fd..97bc005e407 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/issue/filter/FilterableIssue.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/issue/filter/FilterableIssue.java @@ -19,7 +19,6 @@ */ package org.sonar.api.scan.issue.filter; -import java.util.Date; import javax.annotation.CheckForNull; import javax.annotation.concurrent.ThreadSafe; import org.sonar.api.batch.fs.TextRange; @@ -64,12 +63,6 @@ public interface FilterableIssue { @CheckForNull Double gap(); - /** - * @deprecated since 6.6 useless since creation date is computed on server side - */ - @Deprecated - Date creationDate(); - /** * @deprecated since 7.6 filtering issue should not depend on the key */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java deleted file mode 100644 index 53a0402ffaf..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 1.10 - * @deprecated override org.sonar.api.web.AbstractRubyTemplate and implement org.sonar.api.web.RubyRailsWidget - */ -@Deprecated -public abstract class AbstractDashboardWidget extends AbstractRubyTemplate implements RubyRailsWidget { - - @Override - public String getId() { - return getClass().getSimpleName(); - } - - @Override - public String getTitle() { - return getClass().getSimpleName(); - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractRubyTemplate.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractRubyTemplate.java deleted file mode 100644 index 1f1740a5b01..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractRubyTemplate.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.sonar.api.utils.SonarException; - -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * @since 1.11 - * @deprecated since 6.3. This class is ignored. - */ -@Deprecated -public abstract class AbstractRubyTemplate { - - private String cache = null; - - public String getTemplate() { - String result = loadTemplateFromCache(); - try { - if (result == null) { - result = loadTemplateFromClasspath(); - } - if (result == null) { - result = loadTemplateFromAbsolutePath(); - } - return result; - - } catch (IOException e) { - throw new SonarException("Can not read the file " + getTemplatePath(), e); - } - } - - private String loadTemplateFromAbsolutePath() throws IOException { - File file = new File(getTemplatePath()); - if (file.exists()) { - // the result is not cached - return FileUtils.readFileToString(file, UTF_8); - } - throw new FileNotFoundException(getTemplatePath()); - } - - private String loadTemplateFromClasspath() throws IOException { - InputStream input = getClass().getResourceAsStream(getTemplatePath()); - try { - if (input != null) { - cache = IOUtils.toString(input); - return cache; - } - } finally { - IOUtils.closeQuietly(input); - } - return null; - } - - protected String loadTemplateFromCache() { - return cache; - } - - /** - * the path of the template. In production environment, it's the classloader path (for example "/org/sonar/my_template.erb"). - * In dev mode, it's useful to return an absolute path (for example C:/temp/my_template.erb). In such a case the result is not cached. - */ - protected abstract String getTemplatePath(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Dashboard.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Dashboard.java deleted file mode 100644 index 2065b56f4ea..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Dashboard.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Definition of a dashboard. - *
- * Its name and description can be retrieved using the i18n mechanism, using the keys "dashboard.<id>.name" and - * "dashboard.<id>.description". - * - * @since 2.13 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public final class Dashboard { - - private String description; - private DashboardLayout layout = DashboardLayout.TWO_COLUMNS; - private Map> widgetsByColumn = new HashMap<>(); - private boolean activated = true; - private boolean global = false; - - private Dashboard() { - } - - /** - * Creates a new {@link Dashboard}. - */ - public static Dashboard create() { - return new Dashboard(); - } - - /** - * Add a widget with the given parameters, and return the newly created {@link Widget} object if one wants to add parameters to it. - *

The widget ids are listed by the web service /api/widgets - * - * @param widgetId id of an existing widget - * @param columnId column starts with 1. The widget is ignored if the column id does not match the layout. - */ - public Widget addWidget(String widgetId, int columnId) { - if (columnId < 1) { - throw new IllegalArgumentException("Widget column starts with 1"); - } - - Widget widget = new Widget(widgetId); - widgetsByColumn.computeIfAbsent(columnId, x -> new ArrayList<>()).add(widget); - return widget; - } - - public Collection getWidgets() { - return widgetsByColumn.values().stream().flatMap(List::stream).collect(Collectors.toList()); - } - - public List getWidgetsOfColumn(int columnId) { - return widgetsByColumn.get(columnId); - } - - /** - * Returns the description of the dashboard. - * - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * Sets the description of the dashboard. - *
- * Note: you should use the i18n mechanism for the description. - * - * @param description the description to set - */ - public Dashboard setDescription(String description) { - this.description = description; - return this; - } - - /** - * Returns the layout. Default value is the 2 columns mode with width 50%/50%. - * - * @return the layout - */ - public DashboardLayout getLayout() { - return layout; - } - - public Dashboard setLayout(DashboardLayout dl) { - if (dl == null) { - throw new IllegalArgumentException("The layout can not be null"); - } - this.layout = dl; - return this; - } - - /** - * A dashboard is global when it doesn't display information from a project but rather more general information. - *

Before version 3.1 no dashboard was global. - *

Since version 6.1, project dashboards are dropped. Project dashboards (global=false) are ignored.

- * - * @since 3.1 - */ - public boolean isGlobal() { - return global; - } - - /** - * A dashboard is global when it doesn't display information from a project but rather more general information. - *

Before version 3.1 no dashboard was global.

- *

Since version 6.1, project dashboards are dropped. Project dashboards (global=false) are ignored.

- * - * @since 3.1 - */ - public Dashboard setGlobal(boolean global) { - this.global = global; - return this; - } - - /** - * A dashboard can be activated for all anonymous users or users who haven't configured their own dashboards. - *

Before version 3.1 every dashboard created through this extension point was automatically activated. - * This is still the default behavior. - * - * @since 3.1 - */ - public boolean isActivated() { - return activated; - } - - /** - * Set whether the dashboard is activated for all anonymous users or users who haven't configured their own dashboards. - * - * @since 3.1 - */ - public Dashboard setActivated(boolean activated) { - this.activated = activated; - return this; - } - - /** - * Note that this class is an inner class to avoid confusion with the extension point org.sonar.api.web.Widget. - */ - public static final class Widget { - private String id; - private Map properties; - - Widget(String id) { - this.id = id; - this.properties = new HashMap<>(); - } - - public Widget setProperty(String key, String value) { - properties.put(key, value); - return this; - } - - /** - * Returns the properties of this widget. - * - * @return the properties - */ - public Map getProperties() { - return properties; - } - - public String getProperty(String key) { - return properties.get(key); - } - - /** - * Returns the identifier of this widget. - * - * @return the id - */ - public String getId() { - return id; - } - } -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardLayout.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardLayout.java deleted file mode 100644 index 2045c2c0046..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardLayout.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * Possible layouts for a dashboard. - * - * @since 2.13 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public enum DashboardLayout { - - /** - * Only 1 column that take all the page - */ - ONE_COLUMN("100%", 1), - - /** - * 2 columns of the same width - */ - TWO_COLUMNS("50%-50%", 2), - - /** - * 2 columns with the first one smaller than the second - */ - TWO_COLUMNS_30_70("30%-70%", 2), - - /** - * 2 columns with the first one bigger than the second - */ - TWO_COLUMNS_70_30("70%-30%", 2), - - /** - * 3 columns of the same width - */ - TREE_COLUMNS("33%-33%-33%", 3); - - private String code; - private int columns; - - DashboardLayout(String code, int columns) { - this.code = code; - this.columns = columns; - } - - public String getCode() { - return code; - } - - public int getColumns() { - return columns; - } - - @Override - public String toString() { - return code; - } - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardTemplate.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardTemplate.java deleted file mode 100644 index e6c8ba2c85b..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/DashboardTemplate.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; - -/** - * This extension point must be implemented to define a new dashboard. - * - * @since 2.13 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@ServerSide -@ExtensionPoint -public abstract class DashboardTemplate { - - /** - * Returns the {@link Dashboard} object that represents the dashboard to use. - * - * @return the dashboard - */ - public abstract Dashboard createDashboard(); - - /** - * Dashboard name - */ - public abstract String getName(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/DefaultTab.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/DefaultTab.java deleted file mode 100644 index 7b85aa76964..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/DefaultTab.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @since 2.0 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface DefaultTab { - - // default value is all metrics - String[] metrics() default {}; - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java deleted file mode 100644 index ced77f8c5c0..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface Description { - String value(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Footer.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Footer.java deleted file mode 100644 index c0b8c67ee37..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Footer.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; - -/** - * @since 1.10 - * @deprecated since 6.3. This extension is ignored. - */ -@ServerSide -@ExtensionPoint -@Deprecated -public interface Footer { - - /** - * Static HTML - */ - String getHtml(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/NavigationSection.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/NavigationSection.java deleted file mode 100644 index e9f023a3813..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/NavigationSection.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * The Page is displayed only in listed sections. This annotation is ignored on Widgets. - * - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface NavigationSection { - - String HOME = "home"; - String RESOURCE = "resource"; - - /** - * Support removed in 5.1. See https://jira.sonarsource.com/browse/SONAR-6016. - * @deprecated in 4.5, as it costs too much to maintain and update. - * @see SONAR-5321 - */ - @Deprecated - String RESOURCE_TAB = "resource_tab"; - - String CONFIGURATION = "configuration"; - - /** - * Only Ruby and rails application. See "Extend Web Application" section of https://redirect.sonarsource.com/doc/extension-guide.html. - * Use the resource parameter in order to get the current resource. - * - * @since 3.6 - */ - String RESOURCE_CONFIGURATION = "resource_configuration"; - - String[] value() default { HOME }; - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Page.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Page.java deleted file mode 100644 index 7c8551b6d72..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Page.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 2.0 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Deprecated -public interface Page extends View { - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java deleted file mode 100644 index b5fdc9c9e78..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; - -/** - * @since 3.3 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@ServerSide -@ExtensionPoint -@Deprecated -public abstract class PageDecoration extends AbstractRubyTemplate { - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceLanguage.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceLanguage.java deleted file mode 100644 index 53b7bbd3adf..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceLanguage.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * The view is displayed only if the selected resource has the same language. - * - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface ResourceLanguage { - - /** - * An empty value means all resource scopes. - */ - String[] value() default {}; - -} - diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceQualifier.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceQualifier.java deleted file mode 100644 index 4f6153d3d2a..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceQualifier.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * The view is displayed only if the selected resource has the same qualifier. - * - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface ResourceQualifier { - - /** - * An empty value means all resource scopes. - */ - String[] value() default {}; - -} - diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceScope.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceScope.java deleted file mode 100644 index 02c9af7be4c..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceScope.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * The view is displayed only if the selected resource has the same qualifier. - * - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface ResourceScope { - - /** - * An empty value means all resource scopes. - */ - String[] value() default {}; - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsPage.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsPage.java deleted file mode 100644 index 9f32c3b7466..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsPage.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@Deprecated -public interface RubyRailsPage extends Page { - - /** - * @return Content of the Ruby on Rails template - */ - String getTemplate(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsWidget.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsWidget.java deleted file mode 100644 index 8eb35b3e5a9..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsWidget.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * Widget in project dashboard page. It's recommended to also extend AbstractRubyTemplate : - *
- * - * public class MyWidget extends AbstractRubyTemplate implements RubyRailsWidget { - * protected String getTemplatePath() { - * return "/myplugin/my_template.erb"; - * } - * } - * - * - * @since 1.11 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public interface RubyRailsWidget extends Widget { - /** - * @return content of the Ruby on Rails template - */ - String getTemplate(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Section.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Section.java deleted file mode 100644 index d544784c213..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Section.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 1.10 - * @deprecated add annotation org.sonar.api.web.NavigationSection to View extensions - */ -@Deprecated -public enum Section { - HOME, PROJECT, CONFIGURATION -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/View.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/View.java deleted file mode 100644 index 9bc6035e53e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/View.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; - -/** - * @since 1.11 - * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. - */ -@ServerSide -@ExtensionPoint -@Deprecated -public interface View { - - String getId(); - - String getTitle(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Webservice.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Webservice.java deleted file mode 100644 index 49ee8cea1af..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Webservice.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.sonar.api.ExtensionPoint; -import org.sonar.api.server.ServerSide; - -/** - * Interface to create a web service extension point - * - * @since 1.11 - * @deprecated in 4.2. Replaced by {@link org.sonar.api.server.ws.WebService} - */ -@Deprecated -@ServerSide -@ExtensionPoint -public interface Webservice { - - /** - * @return The id of the web service - */ - String getId(); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Widget.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Widget.java deleted file mode 100644 index 2a6fe60ca3e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Widget.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 1.11 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public interface Widget extends View { -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetCategory.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetCategory.java deleted file mode 100644 index c038a8256eb..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetCategory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @since 2.4 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface WidgetCategory { - String[] value(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java deleted file mode 100644 index 3ff542d2fb6..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @since 2.4 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface WidgetLayout { - WidgetLayoutType value(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java deleted file mode 100644 index 05014d5193c..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @since 2.4 - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public enum WidgetLayoutType { - DEFAULT, NONE -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java deleted file mode 100644 index 0abd981ccc3..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@Retention(RetentionPolicy.RUNTIME) -public @interface WidgetProperties { - WidgetProperty[] value() default {}; -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java deleted file mode 100644 index 11a7c330343..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface WidgetProperty { - - String key(); - - WidgetPropertyType type() default WidgetPropertyType.STRING; - - String defaultValue() default ""; - - String description() default ""; - - boolean optional() default true; - - /** - * @since 3.3 Options for property of type {@link WidgetPropertyType#METRIC}. - * - * If no option is specified, any metric will match. - * If options are specified, all must match for the metric to be displayed. - * Three types of filter are supported key:REGEXP, domain:REGEXP and type:comma_separated__list_of_types. - * For example key:new_.* will match any metric which key starts by new_. - * For example type:INT,FLOAT will match any metric of type INT or FLOAT. - * For example type:NUMERIC will match any metric of numerictype. - * - * @since 3.5 Options for property of type {@link WidgetPropertyType#SINGLE_SELECT_LIST}. - * For example {"property_1", "property_3", "property_3"}). - * - */ - String[] options() default {}; -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java deleted file mode 100644 index f645c008896..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -/** - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -public enum WidgetPropertyType { - /** - * Integer value, positive or negative - */ - INTEGER, - - /** - * True/False - */ - BOOLEAN, - - /** - * Floating point number - */ - FLOAT, - - /** - * Basic single line input field - */ - STRING, - - /** - * Sonar Metric - * - * @since 2.10 - */ - METRIC, - - /** - * Measure Filter id - * - * @since 3.1 - */ - FILTER, - - /** - * Issue Filter id - * - * @since 3.7 - */ - ISSUE_FILTER, - - /** - * Multiple line text-area - * - * @since 3.2 - */ - TEXT, - - /** - * Variation of {#STRING} with masked characters - * - * @since 3.2 - */ - PASSWORD, - - /** - * Regular expression - * - * @since 3.2 - */ - REGULAR_EXPRESSION, - - /** - * Single select list with a list of options - * - * @since 3.5 - */ - SINGLE_SELECT_LIST -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetScope.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetScope.java deleted file mode 100644 index 99e3b8e4c10..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetScope.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Depending on its scope, a widget can be available for project dashboards (value = "PROJECT"), - * global dashboards (value = "GLOBAL") or both (value = {"PROJECT", "GLOBAL"}). - * - *

Before version 3.1 all widget had a scope "PROJECT". If a widget is not annotated with @WidgetScope, - * then is is assumed project scoped. - * - * @since 3.1 -/** - * @deprecated since 6.2, this extension is ignored as dashboards have been removed - */ -@Deprecated -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface WidgetScope { - String PROJECT = "PROJECT"; - String GLOBAL = "GLOBAL"; - - String[] value() default PROJECT; -} diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java deleted file mode 100644 index fba1143cb67..00000000000 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.junit.Test; -import org.sonar.api.utils.SonarException; - -import java.net.URL; - -import static org.assertj.core.api.Assertions.assertThat; - -public class AbstractRubyTemplateTest { - - @Test - public void useCacheWhenTemplateIsInClassloader() { - final AbstractRubyTemplate template = new AbstractRubyTemplate() { - @Override - protected String getTemplatePath() { - return "/org/sonar/api/web/AbstractRubyTemplateTest/template.erb"; - } - }; - - assertThat(template.loadTemplateFromCache()).isNull(); - assertThat(template.getTemplate()).isEqualTo("ok"); - assertThat(template.loadTemplateFromCache()).isEqualTo("ok"); - } - - @Test - public void doNotCacheWhenAbsolutePath() { - final AbstractRubyTemplate template = new AbstractRubyTemplate() { - @Override - protected String getTemplatePath() { - final URL url = AbstractRubyTemplateTest.class.getResource("/org/sonar/api/web/AbstractRubyTemplateTest/template.erb"); - return url.getPath(); - } - }; - - assertThat(template.loadTemplateFromCache()).isNull(); - assertThat(template.getTemplate()).isEqualTo("ok"); - assertThat(template.loadTemplateFromCache()).isNull(); - } - - @Test(expected = SonarException.class) - public void failIfTemplateNotFound() { - final AbstractRubyTemplate template = new AbstractRubyTemplate() { - @Override - protected String getTemplatePath() { - return "/unknown.erb"; - } - }; - - template.getTemplate(); - } -} diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/DashboardTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/DashboardTest.java deleted file mode 100644 index 11329ebf1b2..00000000000 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/DashboardTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.api.web; - -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class DashboardTest { - - @Test - public void shouldCreateDashboard() { - Dashboard dashboard = Dashboard.create(); - assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS); - assertThat(dashboard.getDescription()).isNull(); - assertThat(dashboard.getWidgets()).hasSize(0); - } - - @Test - public void shouldAddWidgets() { - Dashboard dashboard = Dashboard.create(); - Dashboard.Widget mostViolatedRules = dashboard.addWidget("most_violated_rules", 1); - assertThat(mostViolatedRules.getId()).isEqualTo("most_violated_rules"); - assertThat(dashboard.getWidgets()).hasSize(1); - assertThat(dashboard.getWidgetsOfColumn(1)).hasSize(1); - - dashboard.addWidget("hotspots", 1); - assertThat(dashboard.getWidgets()).hasSize(2); - assertThat(dashboard.getWidgetsOfColumn(1)).hasSize(2); - - // widgets are sorted by order of insertion - assertThat(dashboard.getWidgetsOfColumn(1).get(1).getId()).isEqualTo("hotspots"); - } - - @Test - public void shouldAddWidgetsOnDifferentColumns() { - Dashboard dashboard = Dashboard.create(); - - dashboard.addWidget("most_violated_rules", 1); - assertThat(dashboard.getWidgets().size()).isEqualTo(1); - assertThat(dashboard.getWidgetsOfColumn(1).size()).isEqualTo(1); - - dashboard.addWidget("hotspots", 2); - assertThat(dashboard.getWidgets().size()).isEqualTo(2); - assertThat(dashboard.getWidgetsOfColumn(2).size()).isEqualTo(1); - } - - @Test - public void shouldAddSeveralTimesTheSameWidget() { - Dashboard dashboard = Dashboard.create(); - dashboard.addWidget("most_violated_rules", 1); - dashboard.addWidget("most_violated_rules", 1).setProperty("foo", "bar"); - - assertThat(dashboard.getWidgets().size()).isEqualTo(2); - assertThat(dashboard.getWidgetsOfColumn(1).get(0).getProperties().size()).isEqualTo(0); - assertThat(dashboard.getWidgetsOfColumn(1).get(1).getProperty("foo")).isEqualTo("bar"); - } - - @Test - public void shouldSetWidgetProperty() { - Dashboard dashboard = Dashboard.create(); - Dashboard.Widget widget = dashboard.addWidget("fake-widget", 1); - widget.setProperty("foo", "bar"); - - assertThat(widget.getProperties().get("foo")).isEqualTo("bar"); - } -} diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java index e18f97c1235..6c3bfd7718b 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java @@ -41,7 +41,7 @@ public class ScannerWsClientProvider extends ProviderAdapter { public synchronized DefaultScannerWsClient provide(final RawScannerProperties scannerProps, final EnvironmentInformation env, GlobalAnalysisMode globalMode, System2 system) { if (wsClient == null) { - String url = defaultIfBlank(scannerProps.property("sonar.host.url"), CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE); + String url = defaultIfBlank(scannerProps.property("sonar.host.url"), "http://localhost:9000"); HttpConnector.Builder connectorBuilder = HttpConnector.newBuilder(); String timeoutSec = defaultIfBlank(scannerProps.property(READ_TIMEOUT_SEC_PROPERTY), valueOf(DEFAULT_READ_TIMEOUT_SEC)); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultFilterableIssue.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultFilterableIssue.java index 3c95ee1ee5e..056c3814f75 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultFilterableIssue.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultFilterableIssue.java @@ -19,30 +19,26 @@ */ package org.sonar.scanner.issue; -import java.util.Date; import javax.annotation.concurrent.ThreadSafe; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.sonar.api.batch.fs.InputComponent; import org.sonar.api.batch.fs.TextRange; -import org.sonar.api.rule.RuleKey; -import org.sonar.api.scan.issue.filter.FilterableIssue; -import org.sonar.scanner.ProjectInfo; import org.sonar.api.batch.fs.internal.DefaultInputProject; import org.sonar.api.batch.fs.internal.DefaultTextPointer; import org.sonar.api.batch.fs.internal.DefaultTextRange; +import org.sonar.api.rule.RuleKey; +import org.sonar.api.scan.issue.filter.FilterableIssue; import org.sonar.scanner.protocol.output.ScannerReport.Issue; @ThreadSafe public class DefaultFilterableIssue implements FilterableIssue { private final Issue rawIssue; private final InputComponent component; - private final ProjectInfo projectInfo; private DefaultInputProject project; - public DefaultFilterableIssue(DefaultInputProject project, ProjectInfo projectInfo, Issue rawIssue, InputComponent component) { + public DefaultFilterableIssue(DefaultInputProject project, Issue rawIssue, InputComponent component) { this.project = project; - this.projectInfo = projectInfo; this.rawIssue = rawIssue; this.component = component; } @@ -89,11 +85,6 @@ public class DefaultFilterableIssue implements FilterableIssue { return rawIssue.getGap() != 0 ? rawIssue.getGap() : null; } - @Override - public Date creationDate() { - return projectInfo.getAnalysisDate(); - } - @Override public String projectKey() { return project.key(); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueFilters.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueFilters.java index dfad698a047..4d98bb5278a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueFilters.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueFilters.java @@ -20,11 +20,10 @@ package org.sonar.scanner.issue; import org.sonar.api.batch.fs.InputComponent; +import org.sonar.api.batch.fs.internal.DefaultInputProject; import org.sonar.api.scan.issue.filter.FilterableIssue; import org.sonar.api.scan.issue.filter.IssueFilter; import org.sonar.api.scan.issue.filter.IssueFilterChain; -import org.sonar.scanner.ProjectInfo; -import org.sonar.api.batch.fs.internal.DefaultInputProject; import org.sonar.scanner.protocol.output.ScannerReport; /** @@ -34,20 +33,18 @@ import org.sonar.scanner.protocol.output.ScannerReport; public class IssueFilters { private final IssueFilterChain filterChain; private final DefaultInputProject project; - private final ProjectInfo projectInfo; - public IssueFilters(DefaultInputProject project, ProjectInfo projectInfo, IssueFilter[] exclusionFilters) { + public IssueFilters(DefaultInputProject project, IssueFilter[] exclusionFilters) { this.project = project; this.filterChain = new DefaultIssueFilterChain(exclusionFilters); - this.projectInfo = projectInfo; } - public IssueFilters(DefaultInputProject project, ProjectInfo projectInfo) { - this(project, projectInfo, new IssueFilter[0]); + public IssueFilters(DefaultInputProject project) { + this(project, new IssueFilter[0]); } public boolean accept(InputComponent component, ScannerReport.Issue rawIssue) { - FilterableIssue fIssue = new DefaultFilterableIssue(project, projectInfo, rawIssue, component); + FilterableIssue fIssue = new DefaultFilterableIssue(project, rawIssue, component); return filterChain.accept(fIssue); } diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/DefaultFilterableIssueTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/DefaultFilterableIssueTest.java index d55bcc0fab3..87b7055e20c 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/DefaultFilterableIssueTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/DefaultFilterableIssueTest.java @@ -19,11 +19,9 @@ */ package org.sonar.scanner.issue; -import java.util.Date; import org.junit.Before; import org.junit.Test; import org.sonar.api.batch.fs.InputComponent; -import org.sonar.scanner.ProjectInfo; import org.sonar.api.batch.fs.internal.DefaultInputProject; import org.sonar.scanner.protocol.Constants.Severity; import org.sonar.scanner.protocol.output.ScannerReport.Issue; @@ -36,14 +34,12 @@ import static org.mockito.Mockito.when; public class DefaultFilterableIssueTest { private DefaultFilterableIssue issue; private DefaultInputProject mockedProject; - private ProjectInfo projectInfo; private InputComponent component; private Issue rawIssue; @Before public void setUp() { mockedProject = mock(DefaultInputProject.class); - projectInfo = mock(ProjectInfo.class); component = mock(InputComponent.class); when(component.key()).thenReturn("foo"); } @@ -70,13 +66,11 @@ public class DefaultFilterableIssueTest { @Test public void testRoundTrip() { rawIssue = createIssue(); - issue = new DefaultFilterableIssue(mockedProject, projectInfo, rawIssue, component); + issue = new DefaultFilterableIssue(mockedProject, rawIssue, component); - when(projectInfo.getAnalysisDate()).thenReturn(new Date(10_000)); when(mockedProject.key()).thenReturn("projectKey"); assertThat(issue.componentKey()).isEqualTo(component.key()); - assertThat(issue.creationDate()).isEqualTo(new Date(10_000)); assertThat(issue.line()).isEqualTo(30); assertThat(issue.textRange().start().line()).isEqualTo(30); assertThat(issue.textRange().start().lineOffset()).isEqualTo(10); @@ -90,7 +84,7 @@ public class DefaultFilterableIssueTest { @Test public void nullValues() { rawIssue = createIssueWithoutFields(); - issue = new DefaultFilterableIssue(mockedProject, projectInfo, rawIssue, component); + issue = new DefaultFilterableIssue(mockedProject, rawIssue, component); assertThat(issue.line()).isNull(); assertThat(issue.gap()).isNull(); -- 2.39.5