From 05c8a2e004e9cc17a4d5963a42c835753eefb367 Mon Sep 17 00:00:00 2001 From: Michal Duda Date: Fri, 7 Jun 2019 12:25:22 +0200 Subject: SONAR-12197 completely drop "sonar.branch" code --- .../main/java/org/sonar/api/CoreProperties.java | 6 ----- .../api/batch/bootstrap/ProjectDefinition.java | 23 ----------------- .../org/sonar/api/batch/bootstrap/ProjectKey.java | 30 ---------------------- .../sonar/api/batch/bootstrap/ProjectReactor.java | 5 ++-- 4 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java (limited to 'sonar-plugin-api/src') 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 4f2dbe91fa1..6f693c89334 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 @@ -139,12 +139,6 @@ public interface CoreProperties { /* Global settings */ String SONAR_HOME = "SONAR_HOME"; - /** - * @deprecated since 6.7. This feature is deprecated in favor of the new branch feature. - * @see https://redirect.sonarsource.com/doc/branches.html/a> - */ - @Deprecated - String PROJECT_BRANCH_PROPERTY = "sonar.branch"; String PROJECT_VERSION_PROPERTY = "sonar.projectVersion"; String BUILD_STRING_PROPERTY = "sonar.buildString"; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java index 2dbdd8d2fb0..40d293da8de 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java @@ -166,29 +166,6 @@ public class ProjectDefinition { return properties.get(CoreProperties.PROJECT_KEY_PROPERTY); } - /** - * @since 4.5 - */ - public String getKeyWithBranch() { - String branch = getBranch(); - String projectKey = getKey(); - if (StringUtils.isNotBlank(branch)) { - projectKey = String.format("%s:%s", projectKey, branch); - } - return projectKey; - } - - @CheckForNull - public String getBranch() { - String branch = properties.get(CoreProperties.PROJECT_BRANCH_PROPERTY); - if (StringUtils.isNotBlank(branch)) { - return branch; - } else if (parent != null) { - return parent.getBranch(); - } - return null; - } - /** * @deprecated since 7.7, use {@link #getOriginalProjectVersion()} instead */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java deleted file mode 100644 index a1e4f2661c0..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2019 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.batch.bootstrap; - -/** - * Provides root project key with branch - * @deprecated since 7.6 - */ -@Deprecated -@FunctionalInterface -public interface ProjectKey { - String get(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java index 1883e060151..8fe47237acf 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java @@ -19,10 +19,9 @@ */ package org.sonar.api.batch.bootstrap; -import org.sonar.api.scanner.ScannerSide; - import java.util.ArrayList; import java.util.List; +import org.sonar.api.scanner.ScannerSide; /** * Mutable project definitions that can be modified by {@link ProjectBuilder} extensions. @@ -73,7 +72,7 @@ public class ProjectReactor { public String get() { if (root != null) { - return root.getKeyWithBranch(); + return root.getKey(); } return null; } -- cgit v1.2.3